Problem translating a cmd command into batch

June 27, 2011 at 14:44:50
Specs: Windows 7
Hello, i am trying to make a one line batch file with the following line:

shutdown /s /f /t 0

however, when i run the batch file, i get the repeating line (with @echo off):

Waiting for 10 seconds, press a key to continue ...

(after finishing it starts over)
but when i put the exact same command line into cmd.exe it runs fine and executes

can someone tell me why it isnt working in the batch format? (also i'd like people avoid testing the command if they can and have their computers shut down just in case it does work)

thanks for your help!

See More: Problem translating a cmd command into batch

Report •

June 27, 2011 at 15:01:14
-t xx =Set timeout to shutdown for xx seconds.

I think that's your problem, since 0 should count as x, where 10 would work, since it is xx. I hope this helps!

EDIT: I saw that you had Windows 7, so I'm not sure if it is compatible...

Report •

June 27, 2011 at 15:06:40
nope... it does the same for whatever i set the seconds for
shutdown /s /f /t 25
it still counts down from 10 and repeats.., and i have used the command before in a batch and it has worked before.. im not sure why it isnt working now though..

Report •

June 28, 2011 at 03:44:56
Try shutdown -s -f -t 0

Report •

Related Solutions

June 28, 2011 at 05:10:26
nope sorry.. same result. this is very strange

Report •

June 29, 2011 at 03:52:00
Hello! i have found the problem, thanks to everyone who tried to help.

i made the mistake of naming the batch file "shutdown.bat", and the directory of the cmd was set to my desktop.. which is where my shutdown.bat was, so when it ran the command "shutdown /s /f /t 0" it was recognizing the file (itself) and not the command.

all i had to do was change the name of the batch file, and problem solved!

Report •

Ask Question