For shutdown:
c:\windows\system32\shutdown -s -f -t 00
(or do ...shutdown -p -f
).
E.g.: set the time -t 1000
and save and run it.
To abort just c:\windows\system32\shutdown -a
in different batch file.
Very important point to note: if you locate this batch file in your startup then it will execute the s/h/r
immediately. E.g. you create a logoff batch file and you locate it in startup
it will logoff the pc within the given time/immediately. However, when you hold shift when logging then it will abort the logoff batch file otherwise you pc will logoff again and again. You don't have to do this I am not sure if it works on every PC.
Create a user and try it there in case you could not log in. good luck
For restart:
c:\windows\system32\shutdown -r -t 00
For hibernate:
c:\windows\system32\shutdown /h
Reference: https://www.instructables.com/id/Shutdown-restart-or-hibernate-your-computer-on-a/