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.
Pause a batch file for 10 sec'
Name: Borg Date: November 5, 2001 at 23:52:52 Pacific
Comment:
Hi,
Does anybody know how to stop a batch file for 10 sec' or so....
Name: DoOMsdAY Date: November 6, 2001 at 03:49:27 Pacific
Reply:
Check out the "choice" command. It'll look something like this: "choice /c:x /t:10" where 'x' is your exit key.
0
Response Number 2
Name: A.H. Date: November 7, 2001 at 07:32:18 Pacific
Reply:
Not exactly, Doomsday!
Add this line to your batch file
CHOICE /C:x /T:x,10 > NUL
Now, when the batch has executed to this line it will hold for ten seconds, unless you press the 'x' key (change it to anything you want). The "> NUL" at the end does that "[X]?" etc doesnt display.
0
Response Number 3
Name: DoOMsdAY Date: November 7, 2001 at 09:30:12 Pacific
Reply:
Oops, yeah, I forgot about the default selection for when timeout occurs - the thing before the ',' and after the '/t:'. Plus the NUL is a nice touch for clean output. Thanks A.H.
0
Response Number 4
Name: Laurence Date: November 8, 2001 at 13:05:56 Pacific
Reply:
12. A timed delay which can not be interfered with from the keyboard. :: Substitute 5 with the desired number of seconds, up to 99. TYPE nul |CHOICE.COM /N /CY /TY,5 >nul
Name: Norm Date: April 1, 2002 at 11:13:14 Pacific
Reply:
how do you pause a batch file in a NT environment that doesn't have choice.com? thanks! Norm
0
Response Number 6
Name: Pete Date: April 5, 2002 at 06:09:18 Pacific
Reply:
For NT, you need sleep.exe, which comes with the resource kits for NT 4, Windows 98, and Windows 2000. Then you can simply invoke a non-interruptible pause as follows:
sleep 5
where the integer is the number of seconds you wish to pause for.
Summary: How do I input a value using a batch file. For example, In perl i would say $input = ""; similairly in a unix shell scrips I will say read input; MY QUESTION IS HOW TO ACHIEVE THIS IN MS-DOS BATCH FIL...
Summary: I would like to create a batch file for a client/server environment which run if the date of the file does not match. How would the if statement be worded, is it possible?? Thanks in advance. ie: If...