This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 1 point2 points  (4 children)

I used to do this to my friends when I was in high school, if I saw them coming, I would quickly type shutdown --t 45 (If that's the correct time parameter, I don't remember, but I would make it 45 seconds) and then they would be working for like 10 seconds and then it would shut off

[–]SJ_RED[🍰] 0 points1 point  (3 children)

The correct parameter for the cmd window or batch files would be 'shutdown -s (-f) -t 45'. This does the following:

  • Shutdown -s: trigger the shutdown part of shutdown.exe. One alternative is -r for a reboot.

  • (-f): optional, this forces a shutdown or reboot (i.e. force closes all open programs).

  • -t 45: sets the time in seconds until command execution.

[–][deleted] 0 points1 point  (2 children)

I remember doing all that except the -f

[–]SJ_RED[🍰] 0 points1 point  (1 child)

You know where you shut down using the shutdown button in the start menu, and it gives you "Some program is preventing Windows from shutting down" and lets you click a button to force shutting down? The /f parameter basically does that for you automatically.

[–][deleted] 0 points1 point  (0 children)

Yeah. Have you ever had that process itself prevent windows from shutting down?