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 executescan 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!
-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...
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..
Try shutdown -s -f -t 0
nope sorry.. same result. this is very strange
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!
Yes (14) | ![]() | |
No (14) | ![]() | |
I don't know (15) | ![]() |