To register for an Internet.com membership to receive newsletters and white papers, use the Register button ABOVE.
To participate in the message forums BELOW, click here

WinDrivers Computer Tech Support Forums  

Go Back   WinDrivers Computer Tech Support Forums > Operating Systems > DOS

DOS Get support help for all versions of DOS.

Reply
 
Thread Tools Search this Thread Display Modes
Old July 17th, 2001, 03:03 PM   #1
beach101
Registered User
 
Join Date: Sep 2000
Location: Jacksonville, FL USA
Posts: 35
Question Put a delay in a batch job?

Ok, it's been a long time since I wrote a DOS batch job and I could have sworn that there was a 'wait' command? Need to introduce a delay before executing a command. Any ideas?

Thanks for your help.
beach101 is offline   Reply With Quote
Old July 17th, 2001, 03:46 PM   #2
shamus
Registered User
 
shamus's Avatar
 
Join Date: Apr 2001
Location: Cornish,Maine,USA
Posts: 3,136
Post

I think 'pause' would do the trick...
shamus is offline   Reply With Quote
Old July 17th, 2001, 06:51 PM   #3
MacGyver
Registered User
 
MacGyver's Avatar
 
Join Date: Oct 2000
Location: Ottawa
Posts: 4,231
Post

Pause won't work, it only waits for user to strike a key before continuing.

What you need is this:

choice /n/t:c,25/c:cc

Basically the CHOICE command is used to accept menu choices in a batch file. If the user doesn't select an option, you can have it automatically choose an option.

In this case, we don't have any options and are basically only using the timer. You can have whatever delay you want (in seconds) just change the number in the command above to whatever you need.
MacGyver is offline   Reply With Quote
Old July 17th, 2001, 07:15 PM   #4
DR
Registered User
 
Join Date: Apr 2000
Location: St. Paul IN USA
Posts: 274
Cool

I have found this site to be helpful in writing batch files. http://www.computerhope.com
This link leads to a page describing how to write a batch file delay. I'm not sure this fits your case. It read like it delayed the start of the run. It does give a good example of the CHOICE command at top of page. http://www.computerhope.com/batch.htm#4
They also have some useful utilities. One changes BAT files to COM files. The Tech guide is full of helpful tips and guides on how to write what you want.
__________________
Computers follow your orders, not your intentions.
DR is offline   Reply With Quote
Old July 18th, 2001, 11:57 AM   #5
beach101
Registered User
 
Join Date: Sep 2000
Location: Jacksonville, FL USA
Posts: 35
Thumbs up

I never would have thought of the Choice command. Brilliant. You guys are great. Thanks. <IMG SRC="smilies/smile.gif" border="0">
beach101 is offline   Reply With Quote
Old July 22nd, 2001, 12:39 AM   #6
Gabriel
Registered User
 
Gabriel's Avatar
 
Join Date: Aug 2000
Location: Tel Aviv Israel
Posts: 2,159
Post

Quote:
Originally posted by MacGyver:
<STRONG>Pause won't work, it only waits for user to strike a key before continuing.

What you need is this:

choice /n/t:c,25/c:cc

Basically the CHOICE command is used to accept menu choices in a batch file. If the user doesn't select an option, you can have it automatically choose an option.

In this case, we don't have any options and are basically only using the timer. You can have whatever delay you want (in seconds) just change the number in the command above to whatever you need.</STRONG>
is there any similar to NT4 Command Prompt?
__________________
Real stupidity beats Artifical Intelligence
Avatar courtesy of A D E P T
Gabriel is offline   Reply With Quote
Old July 22nd, 2001, 06:44 AM   #7
Outcoded
Senior Member - 1000+ Club
 
Outcoded's Avatar
 
Join Date: Apr 2001
Location: Somewhere in the UK, never quite sure where
Posts: 1,689
Post

dir c:\ /s > nul
dir c:\ /s > nul
dir c:\ /s > nul
dir c:\ /s > nul
dir c:\ /s > nul
dir c:\ /s > nul
dir c:\ /s > nul
dir c:\ /s > nul
dir c:\ /s > nul
dir c:\ /s > nul
dir c:\ /s > nul

That oughta slow it down a bit <IMG SRC="smilies/biggrin.gif" border="0">
__________________
I'm in charge and I say we blow it up
Outcoded is offline   Reply With Quote
Old July 23rd, 2001, 02:26 PM   #8
Penman
Registered User
 
Penman's Avatar
 
Join Date: Apr 2001
Location: Scotland
Posts: 104
Post

Following command should stop the computer for 5 seconds, you can increase it up to 99
I think (been a while!)

TYPE NUL | CHOICE.COM /N /CY /TY,5 >NUL
Penman is offline   Reply With Quote
Reply

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -5. The time now is 05:49 AM.



Acceptable Use Policy

internet.comMediabistrojusttechjobs.comGraphics.com

WebMediaBrands Corporate Info


Advertise | Newsletters | Feedback | Submit News

Legal Notices | Licensing | Permissions | Privacy Policy

Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.