locked
run Shutdown.cmd instead of shutdown.exe, Windows 10 RRS feed

  • Question

  • I could not find a reasonable forum for this question. Please direct me?

    I run virtual machines on a Windows 10 PC. To avoid shutting down the host PC while VMs are running I have removed Shut Down, Restart, and Log Off from the Start menu. I use shutdown.exe from Run... with appropriate switches, like this:

    shutdown -s -t 10

    shutdown -r -t 10

    Please note that I type "shutdown", not "shutdown.exe".

    I would like to have "shutdown" run shutdown.cmd, a batch file that I make which would hibernate all my VMs first, then run shutdown.exe. I vaguely remember something like this was possible back in ME days, is it possible now? I have tried putting shutdown.cmd in c:\windows, and the folders under Windows where shutdown.exe resides (system32 and syswow64). I have moved .CMD in front of .EXE in the PATH environment variable. But "shutdown" always calls "shutdown.exe", not the .cmd. I have tried renaming shutdown.exe to something else and was blocked by Windows. I tried taking ownership of shutdown.exe and was again blocked.

    I have tried using the Group Policy shutdown scripts, but the VMs are killed off long before those scripts start running.

    I know I can type "shutdown.cmd" instead of just "shutdown", but I might forget one day. Is it possible to get Windows to run the .cmd first before it runs an .exe?

    Friday, September 16, 2016 3:17 PM

Answers

All replies