0

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?

Thanks

3
  • 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: computerhope.com/shutdown.htm May 6, 2010 at 23:59
  • It works for me, although it doesn't wait 10 seconds for some reason, it just logs out immediately May 7, 2010 at 0:01
  • @Michael: It's not supposed to wait. The -t arg is a timeout not a wait period. May 7, 2010 at 1:17

3 Answers 3

2

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

0

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.

1
  • No, using the -t with -l still just brings up the help details
    – Stephen
    Jun 21, 2014 at 7:30
0

http://sourceforge.net/projects/logout/

Description

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.

1
  • 2
    Care to explain a little what this does?
    – slhck
    Apr 29, 2012 at 7:07

You must log in to answer this question.