[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

batch/ wait

Posted on 2010-01-01
3
Medium Priority
?
621 Views
Last Modified: 2012-05-08
Hi,

How  can i executive first line of command , then  wait  10 seconds , then execute others


cd Y:\
md Y:\FoxproserverBackup\%date:~0,4%%date:~5,2%%date:~8,2%
xcopy /Y /Q /S Z:\HKMDATA Y:\FoxproserverBackup\%date:~0,4%%date:~5,2%%date:~8,2%


Regards
Stanley
0
Comment
Question by:candychan611
3 Comments
 
LVL 97

Accepted Solution

by:
Lee W, MVP earned 200 total points
ID: 26160134
You can ping.

cd Y:\
ping -n 10 127.0.0.1
md Y:\FoxproserverBackup\%date:~0,4%%date:~5,2%%date:~8,2%
xcopy /Y /Q /S Z:\HKMDATA Y:\FoxproserverBackup\%date:~0,4%%date:~5,2%%date:~8,2%

Though I prefer using a sleep utility, you'd need to download it.
0
 
LVL 59

Expert Comment

by:Bill Prew
ID: 26160167
Some good variety of approaches discussed on these pages:

http://www.robvanderwoude.com/wait.php

http://www.allenware.com/icsw/icswref.htm#Delays

~bp
0
 
LVL 12

Expert Comment

by:jazzIIIlove
ID: 26160170
Hi there;

As leew suggests ping does the job.
http://www.robvanderwoude.com/wait.php

or you can use the following python script. If you have python installed.
import time, sys
time.sleep(float(sys.argv[1]))

There are lots of opinions in stackoverflow:
http://stackoverflow.com/questions/166044/sleeping-in-a-dos-batch-file

Best regards.
0

Featured Post

Important Lessons on Recovering from Petya

In their most recent webinar, Skyport Systems explores ways to isolate and protect critical databases to keep the core of your company safe from harm.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The following is a collection of cases for strange behaviour when using advanced techniques in DOS batch files. You should have some basic experience in batch "programming", as I'm assuming some knowledge and not further explain the basics. For some…
If like me you are one who spends a lot of time working and scripting with cmd.exe, sometimes it is handy to be able to quickly view a calendar for a given month and year. This script will quickly do just that!  Save the code posted below to a .bat …
Look below the covers at a subform control , and the form that is inside it. Explore properties and see how easy it is to aggregate, get statistics, and synchronize results for your data. A Microsoft Access subform is used to show relevant calcul…
As many of you are aware about Scanpst.exe utility which is owned by Microsoft itself to repair inaccessible or damaged PST files, but the question is do you really think Scanpst.exe is capable to repair all sorts of PST related corruption issues?

873 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question