Search code examples
windowsbatch-filecmdshutdown

Shutdown via batch file into infinite loop?


Problem:

While running the batch file, it goes into infinite loop

Code:

shutdown -s -t 050

Output:

Ran the batch file enter image description here

Output when i run in normal batch file: enter image description here

Output when i run in admin batch file:

enter image description here

Question: Now I wonder why this happens, and want to know how to run shutdown command normally from batch file, if not like this ?


Solution

  • You called the batch file shutdown

    Use a name that is not a system command or internal command.