I have a very specific requirement. I am attempting to upload files via sftp which uses private keys. I already have a bat file that connects to the host and uploads the file however I need to move the uploaded files once completed to another path.
The first bat file is called start.bat
. This connects to the sftp server and uploads the file. I am using winscp to connect to the host.
The second bat file is called done.bat
. This moves files from one directory to another.
I am calling the second bat file from the first using call done.bat
. The issue I have is that done.bat
is completed even before the first batch file has had the chance to authenticate, login and upload.
I want to only move the file once the upload has completed. If the upload fails for some reason, the second file doesn't execute.
The bat files are on a Windows XP machine.