Use Group Policy Editor To Run Scripts When Shutting Down Your PC

Use Group Policy Editor To Run Scripts When Shutting Down Your PC

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:

  1. Open GPE by entering “gpedit.msc” (no quotes) into the Run dialog (Win+R).
  2. In the left panel, select “Windows Settings” under “Computer Configuration”.
  3. Double-click “Scripts (Startup/Shutdown)” in the right panel.
  4. Double-click “Shutdown”
  5. Click “Add…”
  6. Navigate to the folder containing the script you want to run.
  7. 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]


  • 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.

Show more comments

Comments are closed.

Log in to comment on this story!