Windows: To automate some routine tasks that nobody likes doing during the day, you can use Group Policy Editor to make your PC run a script when you shut it down or log off a user account.
To set up a script to run as soon as you shut down your PC, follow these instructions:
- Open GPE by entering “gpedit.msc” (no quotes) into the Run dialog (Win+R).
- In the left panel, select “Windows Settings” under “Computer Configuration”.
- Double-click “Scripts (Startup/Shutdown)” in the right panel.
- Double-click “Shutdown”
- Click “Add…”
- Navigate to the folder containing the script you want to run.
- Click “OK”.
You can also use this method to run scripts when logging out of a user profile. This is handy for performing regular maintenance tasks, cleaning up your workspace or simply running apps that you don’t want running while you’re using your machine. Unfortunately, the Group Policy Editor is only available on Professional or Ultimate versions of Windows.
Nifty Way to Automatically Run a Windows Script or Program Whenever You Turn Off the PC [Gizmo’s Freeware]
Comments
2 responses to “Use Group Policy Editor To Run Scripts When Shutting Down Your PC”
Cool. Now give examples/links of some handy scripts please!
Uhh, haven’t shutdown scripts been part of group policy since day dot? What the hell are you doing administrating active directory without knowing about this?
Oh, and this article could also be titled “How to train your staff to hard-power off a PC in one easy step – make shutdowns take FOREVER!”
As you can see in the image, this is only modifying the local group policy.
This article clearly aimed at home users. There was no mention of Active Directory in the article at all and in most businesses you wouldn’t be able to modify local policy.
This is actually a great way to automate maintenance tasks at home.