Using Batch File to Move a File
Posted on 2004-11-01
I have a program that ftps a file from one server to another. If this fails it gives an error code of 1. I have written the folllowing batch to handle this so that if it is successful it moves the file to the done folder. If not, it appends text to an error log and leaves the file where it is. The code is:
IF ERRORLEVEL 1 echo ErrorSendingFile %DATE:~10,4%%DATE:~7,2%%DATE:~4,2% >> d:\orders\orders.txt ELSE MOVE d:\orders\*.txt d:\orders\done
The only other output from the FTP is an error code of 0 which occurs if the transfer is successful.
Can anyone correct where I am going wrong as it doesn't sppear to work. Could do with a quick answer to this one if possible so am allocating 300 points for it :o)