Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.
Batch file shutdown timer
Name: coolduderyan07 Date: February 10, 2006 at 17:47:23 Pacific OS: Windows XP home ed. CPU/Ram: pentium 4 Windows Xp 512 Product: Dell
Comment:
Hello, I registered here asking for a bit of help. First off I am very new to this language and i need to make a little program off a batch file. I found out how to shutdown the computer using a batch file.. and how to set a specified time to shut off... the only thing that is in my way.. is basically.. that is all i can do really..
1st it would be nice if someone could help me with some commands... What i want is to have a menu with choices displayed after the batch file is launched that gives you 3 things to choose from.. shutdown in 15 minutes.. shutdown in 30 minutes or shutdown in 60 minutes.. so far all I have is..
Code :
shutdown -s -f -t 300
-(300) is 300 seconds Yea thats pretty much what i am limited to.. it would be really great to have some help on this. Thanks in advance.
Name: CWoodward Date: February 10, 2006 at 20:09:48 Pacific
Reply:
Try this:
@ECHO OFF
CLS
:Start ECHO When do you want to shutdown? ECHO Press number of choice followed by the Enter key ECHO 1: Fifteen Minutes ECHO 2: Thirty Minutes ECHO 3: Sixty Minutes ECHO 4: Quit
SET Choice= SET /P Choice=""
IF '%Choice%'=='1' GOTO Fifteen IF '%Choice%'=='2' GOTO Thirty IF '%Choice%'=='3' GOTO Sixty IF '%Choice%'=='4' GOTO End CLS ECHO "%Choice%" is not valid ECHO Try again GOTO Start
:Fifteen SHUTDOWN -S -F -T 900 GOTO End
:Thirty SHUTDOWN -S -F -T 1800 GOTO End
:Sixty SHUTDOWN -S -F -T 3600 GOTO End
:End CLS
0
Response Number 2
Name: CWoodward Date: February 10, 2006 at 20:12:13 Pacific
Summary: Hi, I'm trying to write a batch file that asks for a number and then uses an external program (which inserts a delay into the file) to delay for that number of seconds. Each time the set amount of tim...
Summary: On my home network I have 4 Windows boxes. 3 are downstairs and 1 is in my room. All of them are pretty lax on security since they have no internet connection. Anyway I can log into each one using nu...
Summary: Hi, I'm looking to create a batch file that first checks if a PC is connected (returns a reply in ping) then if so send a remote shutdown to that PC. So far I have a batch file that parses IP addr...