Search code examples
windowsshutdown

Win 10: Make shutdown script visible


With group policies I have setup a .bat script that runs when windows is shutdown. The script runs an .exe that does a backup of my data. Under Win 7 the execution of the .exe appeared on the screen when windows was shutdown or restarted. This allowed to terminate the backup (.exe provides this option) if it was not required, e.g. in case of a restart.

In my newly setup Windows 10, the script runs (I can tell this from the time the shutdown takes) but the execution of the script is not visible on the screen and can therefore not be terminated if not needed.

Questions:

  • Is there any way to make the execution of the .exe in the shutdown script visible on Win 10?
  • Is it possible to determine inside a .bat script if windows is shutdown or restarted?

Thanks for your help.


Solution

  • There is a setting in gpedit that defines if the statements exeucuted in a shutdown script should be shown.

    • gpedit.msc: computer configuration -> adminstrative templates -> system -> scripts: You find 'Show statements when executing shudown scripts' (or similar since translated from German!). Only if activated will you see what the computer does during shutdown. 'Not activated' is the Default.

    I found the solution via the following question asked here in Stack Overflow