Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm trying to run

shutdown.exe -l -t 10

only showed shutdown help manual.

I thought of inelegant but working solution of

ping -n 10  localhost
shutdown.exe -l

How wasteful is this solution?

I thought of downloading sleep.exe, but I want my bat file to work on a machine with no previous preparations.

Any more ideas?


share|improve this question

migrated from May 8 '10 at 2:22

This question came from our site for professional and enthusiast programmers.

If it's showing the help manual, that means there is a problem with your syntax - but I can't figure out what it is. Here are the command-line args: – Nathan Osman May 6 '10 at 23:59
It works for me, although it doesn't wait 10 seconds for some reason, it just logs out immediately – Michael Mrozek May 7 '10 at 0:01
@Michael: It's not supposed to wait. The -t arg is a timeout not a wait period. – Nathan Osman May 7 '10 at 1:17

It would seem that the -l command is for some reason not compatible with -t.

if you wanted to shutdown the command shutdown -s -t 10 would work, if you wanted to log off after while, you could try using the at command, which schedules a process to be run at a certain time.

at [time] shutdown -l . Not as nice but should work

share|improve this answer

Please note that the -l option just logs you off, it doesn't shutdown nor restart the computer. You could try using

shutdown -l

And it should logoff the computer after 30 seconds.

Anyway, the syntax

shutdown -l -t 10

Is correct, try to copy that line if it doesn't work.

share|improve this answer
No, using the -t with -l still just brings up the help details – Skuld Jun 21 '14 at 7:30


Logout is a simple command line utility to silently force close running applications and log off the current Windows user after a provided number of minutes.

example: "logout 24" would log off the current user after 24 minutes.

share|improve this answer
Care to explain a little what this does? – slhck Apr 29 '12 at 7:07

You must log in to answer this question.