|
Question : How to start an application from a .Bat file and then upload files
|
|
Hi,
I have the following code in an MS DOS .bat file:
start /wait d:\Progra~1\STClient\stclient.exe /quitWhenDone /prefRetries 0 httpsu://[user id]:[password]@[website name] Z:\MyFolder\FileA.cmp
This invokes a secure client, signs onto our site, and then uploads the file specified at the end of the path. We use this for uploading files to the bank. How can I set this up so that it only starts the application once, but then sends 5 different files AND with a 5 minute delay between each transmission?
Thanks !
|
|
Answer : How to start an application from a .Bat file and then upload files
|
|
I'd take a different approach:
====8<----[upload.cmd]---- @echo off setlocal :: *** Uses sleep.exe from the resource kit :: *** Default path to the files to be sent (including trailing "\"): set DefaultPath=Z:\MyFolder\ :: *** A "," separated list of files to send: set FileList=FileA.cmp,FileB.cmp,FileC.cmp,FileD.cmp,FileE.cmp :: *** The delay in minutes between each transfer: set Delay=5
set /a Delay*=60 :loop for /f "tokens=1* delims=," %%a in ("%FileList%") do ( set FileList=%%b start /wait d:\Progra~1\STClient\stclient.exe /quitWhenDone /prefRetries 0 httpsu://[user id]:[password]@[website name] "%DefaultPath%%%a" ) if "%FileList%"=="" goto :eof sleep %Delay% goto loop ====8<----[upload.cmd]----
|
|
|
|