tgarrity
asked on
Delay Copy in Batch File
Is there a way to create a bat file to copy over several files in intervals?
Meaning copy one file then wait 60 seconds and copy over the next file?
Thanks,
Meaning copy one file then wait 60 seconds and copy over the next file?
Thanks,
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
The scenario:
I have a folder on Server A containing 500 .xml files and 15,000 .pdf files.
The .xml files contain info on where to file .pdf files on Server B.
I need to copy one .xml file at a time to Server B every 120 seconds.
The .pdf files can be ignored, but wanted to make everyone aware as a copy *.* will not work in this case. I'm having to copy the .xml files one at a time due to a resource issue on Server B.
If I dump all 500 .xml files onto Server B, Server B will not process the .xml files and in turn will not correctly file the .pdf files.
I have a folder on Server A containing 500 .xml files and 15,000 .pdf files.
The .xml files contain info on where to file .pdf files on Server B.
I need to copy one .xml file at a time to Server B every 120 seconds.
The .pdf files can be ignored, but wanted to make everyone aware as a copy *.* will not work in this case. I'm having to copy the .xml files one at a time due to a resource issue on Server B.
If I dump all 500 .xml files onto Server B, Server B will not process the .xml files and in turn will not correctly file the .pdf files.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Okay, to solve this issue, forget about delays etc... that's nonsense
Your code should consist of a single batch file which reads the information from each xml file one-at-a-time and then process pdf files accordingly.
From a top-level design viewpoint, the code (in pseudocode) shoulf look something like this:
FOR all XML files in the XML folder/s
get the next XML file
process it's data
file PDF files accroding to data
END
It's as simple as that.
I'm busy right now writing code elsewhere however, when I am through with that I will return here to assist you further if in the meantime another expert has not already done so.
Your code should consist of a single batch file which reads the information from each xml file one-at-a-time and then process pdf files accordingly.
From a top-level design viewpoint, the code (in pseudocode) shoulf look something like this:
FOR all XML files in the XML folder/s
get the next XML file
process it's data
file PDF files accroding to data
END
It's as simple as that.
I'm busy right now writing code elsewhere however, when I am through with that I will return here to assist you further if in the meantime another expert has not already done so.
ASKER
I ended up using the following script:
FOR /f "tokens=*" %%a in ('dir /b *.xml') do (
copy "%%a" "Z:\"
ping 1.1.1.1 -n 90
)
pause
Thanks for all the help!
FOR /f "tokens=*" %%a in ('dir /b *.xml') do (
copy "%%a" "Z:\"
ping 1.1.1.1 -n 90
)
pause
Thanks for all the help!
~bp