Shutting down Windows 7 automatically 10 minutes from now

16

5

Is there a way to make Windows 7 do this: "10 minutes from now, close all applications and shut down (or hibernate), no matter what input you get from the keyboard or the mouse"? It's OK if the user can revert the shutdown order during the 10 minute period, but once the shutdown begins there should be no turning back.

user12816

Posted 2011-04-02T10:47:28.453

Reputation: 881

Answers

21

The shutdown command line command is what you're after, with /t 600 you'll get a 600 second (10 minute) delay other options define the shutdown process. In your case I suspect you'll want shutdown /t 600 /s.

Cry Havok

Posted 2011-04-02T10:47:28.453

Reputation: 3 486

chrome browser can as well I believe – Alexey Shevelyov – 2019-02-18T09:46:47.467

1some apps MIGHT stop shutdown. notepad comes to mind. – Journeyman Geek – 2011-04-02T14:17:17.803

3@The Geek: It's not Notepad itself but the "Do you want to save?" dialog box. This is, AFAIK, common to all programs and does make sense. However, 1) IIRC, Windows 7 does not allow programs to stop shutdowns like that anymore; 2) shutdown /f – user1686 – 2011-04-02T17:06:07.410

3

As Havok stated, you can just use the Shutdown switch from command prompt. See options below. enter image description here

Run from cmd.exe or just put into a .bat script as below (and you could just add this .bat to Windows scheduler if you wanted to schedule) - remove the "pause" if you want it to run straight away:

@cd /
@cls
@echo #Shutdown 10min script#
@pause
@shutdown /t 600 /s

James

Posted 2011-04-02T10:47:28.453

Reputation: 1 185

you can use command > foo.txt to direct output to a text file for easy and pasting – Journeyman Geek – 2011-04-02T14:16:20.690

Agreed, but for some reason came out garbled hence pic ;-) – James – 2011-04-02T14:22:02.350

Wrap it in <pre> </pre> tags. – user1686 – 2011-04-02T17:04:45.930

2

There are a number of automatical shutdown programs on the net. You can use one of them; for example: Sweet Dreams.

enter image description here

Mehper C. Palavuzlar

Posted 2011-04-02T10:47:28.453

Reputation: 51 093

1

This can be done by following the simple steps below:

  1. Go to run (Win + r)
  2. Type shutdown -s -t 600 and hit enter

The computer will shut down in exactly 10 minutes (600 seconds).

Krish Munot

Posted 2011-04-02T10:47:28.453

Reputation: 442

0

The first response was adequate. Press Win+r and then type shutdown /t "desired duration" /s in the field. Replace "desired duration" with the amount of seconds you wish your PC to turn off and press Enter.

Nathan

Posted 2011-04-02T10:47:28.453

Reputation: 1

0

I made a script for myself to shutdown the computer after a time interval that I set. this is the code:

:shutdown_sequence
set /p TM="Enter a time to shut down:"
set /a TM1=TM*60
echo I will shutdown the computer in %TM% minutes and in seconds: %TM1% 
shutdown -s -f -t %TM1%
pause
exit
goto:eof

Anon

Posted 2011-04-02T10:47:28.453

Reputation: 1

1Can you explain how the OP would execute this code? – Burgi – 2016-07-18T22:49:22.457

Why do you have a useless goto:eof at the end of your batch file? – DavidPostill – 2016-07-19T00:45:13.707