Hey everyone! I'm trying to restart a server using a batch file, and I came across this command: 'shutdown /r /t 0'. However, the issue is that the command runs, but then it stops when it prompts for a username and password. I really need to get this server back up and running without manual intervention. Does anyone know how to bypass this issue? Thanks in advance!
2 Answers
Are you running the batch file through a scheduled task? You can select 'Run whether user is logged on or not' to save the credentials, and ensure 'run with highest privileges' is checked. That should help!
You might want to tweak your command to 'shutdown /r /f /t 0'. Just a heads up, avoid using this on SQL or other database servers, though!

Also, don’t forget to give the account running the job the Logon as Batch Job permission.