Fix: Gpedit Shutdown Script Not Running or Working

Double-check your script location to ensure it applies

Reading time icon 5 min. read


Readers help support Windows Report. We may get a commission if you buy through our links. Tooltip Icon

Read our disclosure page to find out how can you help Windows Report sustain the editorial team Read more

Key notes

  • If you are using a GPO to shut down your computer and it is not working, there may be an issue with your script.
  • The most common reason for this is a user who does not have permission to run the script.
  • This can be easily resolved by switching to an account with administrative privileges.

Gpedit script is a useful tool that you can use to automate tasks like shutting down your computer at a time specified by you. This can be very helpful for people who work on their computers for long hours and need to take a break.

Unfortunately, running scripts can be a hit or a miss. You can learn more about script errors in our detailed article. For now, letโ€™s find out why this particular one is not running and how to resolve it.

Why is my Gpedit shutdown script not running?

If you have set up a Gpedit shutdown script that runs when you log off, it may not be running as expected. This could be due to several reasons:

  • The script has not been created or saved correctly – To run the script, it must exist in the correct folder location. If the file is stored in another directory, an error message will appear when you try to run the script. The default directory should be: C:\WINDOWS\System32\GroupPolicy\Machine\Scripts\Shutdown
  • Your computer belongs to an Active Directory domain – If your computer belongs to an Active Directory domain, you may need to check the security policy of the domain as an administrator may have locked it.
  • Your script is running under a different user account – If youโ€™re running the Gpedit shutdown script with a different user account than the one shutting down the computer, it may not work. Gpedit shutdown script works by changing registry keys and values. If you have multiple users on your computer, you may have noticed separate registry hives for each user account hence why you need to be keen on the account you’re using.
  • Another program has taken over the shutdown process – This is a common problem and happens because there are some programs that will automatically run at startup or shutdown.
  • The policy isn’t being applied in time – In most cases, if a computer hasn’t rebooted yet after installing a policy update, it will not be processed until after the next reboot. 
  • Virus infection – If your computer has been infected with malware or another kind of virus, it may have modified some system files in such a way that they prevent Gpedit from running properly.

What can I do when my Windows shutdown script not running?

Before any complex solutions, try the following basic workarounds:

  • If the time on your computer is wrong, this could be causing your problem. Make sure that it is set correctly before continuing.
  • Ensure that no other programs are running that may interfere with your script running properly.
  • Make sure that the task has been scheduled in the Task Scheduler.
  • Double-check the script location and ensure it is in the shutdown folder.
  • Verify that the script is set to run under the correct user account with requisite administrative privileges and permissions.
  • Check whether your user profile is corrupt and repair it where necessary.
  • Restart your PC to see if any unfinished policies need to be applied.

1. Add the shutdown script manually 

  1. Hit the Windows + R keys to open the Run command.
  2. Type gpedit.msc in the dialog box and hit Enter.GPEDiT.msc -Windows Remediation Service Failed to Start?
  3. Navigate to the following location: User Configuration /Windows Settings /Scripts /Shutdown
  4. Double-click on Shutdown to open its Properties.
  5. Click on Add.
  6. Enter your script name. Alternatively, you can click on the Show Files to locate it in its folder.

2. Force restart the GPO

  1. Hit the Windows key, type cmd, and select Run as administrator.cmd-run-admin-w11 unexpected kernel mode trap windows 11
  2. Type in the following command and press Enter: GPupdate/force
  3. Reboot your PC.

3. Scan for viruses

  1. Click on the Start Menu icon, search Windows Security, and click Open.
  2. Select Virus & threat protection.
  3. Next, press Quick scan under Current threats.
  4. If you donโ€™t find any threats, proceed to perform a full scan by clicking on Scan options just below Quick scan.Scan options
  5. Click on Full scan, then Scan now to perform a deep scan of your PC.Full Scan Scan Now
  6. Wait for the process to finish and restart your system.

It’s easy to forget how vulnerable Windows is and what damaging things malware can inflict on the computer. If the effects of the infection are beyond Windows Defender’s capabilities, you should try out a more comprehensive antivirus solution, such as ESET HOME Security Premium.

4. Reset Group Policy Editor

  1. Hit the Windows key, type cmd, and select Run as administrator.cmd-run-admin-w11 unexpected kernel mode trap windows 11
  2. Type in the following commands and press Enter after each one: RD /S /Q "%WinDir%\System32\GroupPolicyUsers" && RD /S /Q "%WinDir%\System32\GroupPolicy"gpupdate /force
  3. Restart your PC.

If none of these methods seem to do it for you, perhaps it’s time you tried out third-party applications. You can try out Group Policy Management tools to help you simplify the process.

We also have answers on what to do when your Group Policy keeps reverting, so be sure to check out our article on the same.

Do let us know if your shutdown script has succeeded after trying our recommended fixes.

More about the topics: group policy editor