I wanted to schedule turning off/shutting down Windows processes/applications because as time passes during my day at my computer, I open more and more applications and they get crowded in my workspace. This is why, I decided to create a PowerShell script that I would execute as soon as I’ve opened my computer. A form of a scheduler that stops applications while I’m working at my computer.
And the script is a pretty easy one. Basically, the script consists of 2 commands: one command that tells the script to “wait” X seconds and a 2nd command that will actually stop/shutdown the Windows process/application that you need.
.ps1extension. For example:
Start-sleepcommand, along with the
-swill tell the script to wait 10 seconds before the next command:
Start-Sleep -s 10
Stop-processcommand will now close a running Windows process/application. In the example below, we’ll decide to close uTorrent, 10 seconds after I will run the
close_processes.ps1script. It’s pretty useful for me whenever I need to schedule Windows services to be closed, especially when I’m late in the night, almost in a nice limbo state of remote work and forget to close windows I’m not using anymore so that I can relieve some hardware resources.
Stop-Process -Name uTorrent
We can also stop a even more diverse range of Windows processes, like the popular FileZilla, Chrome web browser, VLC player, Microsoft Edge web browser. But we can also close them, one by one or in groups, at different times. In the example below, I’ll:
Start-Sleep -s 7200 Stop-Process -Name uTorrent Start-Sleep -s 32400 Stop-Process -Name ScreenSketch Stop-Process -Name filezilla Stop-Process -Name chrome Stop-Process -Name vlc Stop-Process -Name msedge
Once you’ve finished writing your own PowerShell scheduler, you’ll need to run the script.