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


  1. Posts : 6
    Windows 10
       #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,
    Dirk
      My Computer


  2. Posts : 3,453
       #2

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


  3. Posts : 6
    Windows 10
    Thread Starter
       #3

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


  4. Posts : 3,453
       #4

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


  5. Posts : 6
    Windows 10
    Thread Starter
       #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 Computer


  6. Posts : 3,453
       #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 Computer


  7. Posts : 6
    Windows 10
    Thread Starter
       #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 Computer


  8. Posts : 3,453
       #8

    Splendid!.. you are welcome.
      My Computer


 

  Related Discussions
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:14.
Find Us




Windows 10 Forums