1.    14 Apr 2016 #1
    Join Date : Mar 2016
    Posts : 6
    Windows 10

    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 System SpecsSystem 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 System SpecsSystem Spec

  3.    14 Apr 2016 #3
    Join Date : Mar 2016
    Posts : 6
    Windows 10

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

  4.    14 Apr 2016 #4

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

  5.    14 Apr 2016 #5
    Join Date : Mar 2016
    Posts : 6
    Windows 10

    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 System SpecsSystem 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 System SpecsSystem Spec

  7.    14 Apr 2016 #7
    Join Date : Mar 2016
    Posts : 6
    Windows 10

    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 System SpecsSystem Spec

  8.    15 Apr 2016 #8

    Splendid!.. you are welcome.
      My System SpecsSystem Spec


Similar Threads
Thread Forum
pc runs on when shutdown in windows 10
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:
General Support
Windows 10 Home Shutdown Script
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...
Solved Screwed shutdown script
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...
General Support
PC Shutdown script does not work
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...
Software and Apps
Computer continuously runs a shell script after upgrading to Windows10
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...
Installation and Setup
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 10:21.
Find Us
Twitter Facebook Google+

Windows 10 Forums