Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

One can open the command line (cmd) and type

shutdown -s -t 1200 

to shut down Windows 8 in 1200 seconds. However, an ugly banner appears over the whole screen 10 minutes before the shutdown! Is there a way to avoid the banner showing up?

enter image description here

share|improve this question
1  
I see no banner when I do this (except the notification in the tray(. Can you take a screen shot? –  ekaj Oct 18 '12 at 5:38
    
imgur.com/AKSMN –  Syzygy Oct 19 '12 at 5:55

3 Answers 3

In PowerShell, use:

timeout -t 1800; shutdown -s

Or in cmd, use:

timeout 1800 && shutdown -s

They will cause a delay of 1,800 seconds (30 minutes), then perform the shutdown.

share|improve this answer
    
Thanks for the edit! –  Syzygy Oct 19 '12 at 15:44
1  
You'll want to use && rather than &. && only executes the right hand side if the left hand side returns an errorlevel of 0 (i.e. successful execution). & will always execute the right hand side. The problem here is that & will execute the right hand side even if you cancel the countdown (with Ctrl + C), which is dangerous. –  Bob Oct 27 '12 at 14:10
    
Thank you! I'll edit his edit :) –  Syzygy Oct 27 '12 at 23:46

You're looking for a "wait" command to add before shutting down, instead of making shutdown do the waiting. According to this question, this should do the trick:

ping -n 1201 127.0.0.1 > nul && shutdown -s

share|improve this answer
    
This doesn't work as written. However, I figured out how to do it anyway. Good idea, I can't believe it hasn't occurred to me that there is a wait command on Windows (I'm used to Linux's shell, and made the bad assumption that Windows can't do anything). –  Syzygy Oct 19 '12 at 5:58
    
If you could let me know what the correct syntax is it would be helpful for people who find this question. –  zmode Oct 19 '12 at 11:12
    
I'm not sure. Probably ping -n 1201 127.0.0.1 > nul; shutdown -s But I added an alternative answer below. You can test by using shutdown -s -t 10 in the command, and then immediately typing shutdown -a to abort the shutdown. EDIT: This might have failed for me because I used PowerShell! –  Syzygy Oct 19 '12 at 15:43
2  
FYI you don't need to use ping anymore to delay scripts/commands. Windows Vista and later have a built-in timeout command which achieves the same purpose in a less roundabout way. –  nhinkle Oct 19 '12 at 19:14

There is a good utility in Sysinternals (now Microsoft) PSTools called psshutdown. I use it since Windows NT for remote shutdown. It can also do a local shutdown. To be honest, I didn't check the differences between psshutdown and shutdown. I think it's worth a try.

As per the delay, why not use the builtin scheduler? I am not familliar with powershell, but I believe that a script could be written that would get current date, time, add a desired interval ant then create a run once scheduled task to execute a shutdown.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.