Windows 10: Shutdown script (gpedit) runs with 'Restart' but not with 'Shut down' Solved

  1.    14 Apr 2016 #1

    Shutdown script (gpedit) runs with 'Restart' but not with 'Shut down'

    Dear all,

    I have an issue with a shutdown script that I don't manage to resolve:
    I wrote a .bat file script that works fine when it is clicked on. Through gpedit.msc, I added it as a shutdown script. When the computer is restarted (Power -> Restart), it works fine as well (I log the results of this batch file to a txt file, so I can check it).
    However, when I do a normal shutdown of the computer (Power -> Shut down, so no automatic restart, but manual restart later on), the script is not activated at all (not even the log.txt file is created).
    My OS is Windows 10 Pro.

    Has anyone run into this problem as well?

    Thanks and kind regards,
      My ComputerSystem Spec

  2.    14 Apr 2016 #2

    Are you sure it's in Shutdown and not Startup? Otherwise perhaps a scheduled task may work better.
      My ComputerSystem Spec

  3.    14 Apr 2016 #3

    Yes, it is in Shutdown.
    I have no scripts in Startup.
      My ComputerSystem Spec

  4.    14 Apr 2016 #4

    ... and it's in C:\WINDOWS\System32\GroupPolicy\Machine\Scripts\Shutdown ?
      My ComputerSystem Spec

  5.    14 Apr 2016 #5

    Yes, it is.
    The script is also mentioned in the C:\WINDOWS\System32\GroupPolicy\Machine\Scripts\scripts.ini file.
    The strange thing is that the script runs indeed when I select Power -> Restart, but it doesn't run when I select Power -> Shut down.
      My ComputerSystem Spec

  6.    14 Apr 2016 #6

    Hmmm... well can't say for sure except the difference between the two is restart is a full boot and shutdown a hibernate boot - up to you play with powercfg settings maybe...
      My ComputerSystem Spec

  7.    14 Apr 2016 #7

    Thanks, I managed to solve the problem with your suggestion!
    When I disable the fast startup (Power options -> Choose what the power buttons do -> Change settings that are currently unavailable), the shutdown script runs during both Restart and Shutdown. It seems that a full boot is needed to make the shutdown script being activated.
      My ComputerSystem Spec

  8.    15 Apr 2016 #8

    Splendid!.. you are welcome.
      My ComputerSystem Spec


Related Threads
Is it possible to run a script on shutdown on Windows 10 Home edition? Group Policy Editor (gpedit.msc) is not available. Already tried to modify registry Execute a script a startup and shutdown Tested successfully on Windows 10 Professional...
Hi, when I shutdown win 10 it goes through the shutdown process the screen goes off but the PC keeps running for 3 to 5 minutes it didn't do this before it has just started in the last week. Any ideas why and how to stop it :huh:
Solved Screwed shutdown script in General Support
Oh Boy, well you learn from your mistakes they say:o I tried to run a script at shutdown on my W10 PC that would run a RoboCopy command. That did not work so I deleted it (So I thought) I may have deleted the proper shutdown script as my PC will...
PC Shutdown script does not work in Software and Apps
Hi, I was used to run a script "at 20:30 shutdown -s" in Run.exe to shutdown my laptop at specific time in Windows 7, but in W10, it does not work. I tried to run this script in cmd.exe as administrator, but it does not work eather, because in...
My PC was running Windows 8.1 with no problem. I upgraded to Windows 10. Installation went fine, but right after I logged in to windows, it started to continuously run a shell script in background. A shell window pops up on the computer screen every...
Our Sites
Site Links
About Us
Windows 10 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 10" and related materials are trademarks of Microsoft Corp.

Designer Media Ltd
All times are GMT -5. The time now is 22:29.
Find Us