Not sure how you can get the email sent just when it fails so what you probably will have to do is add >file.txt onto the xcopy command and then send that file every day.
For the copy proccess, there are many options, including the built in XCOPY command.
Here are some other:
* ROBOCOPY from the NT resource kit.
* XXCOPY from:
For the email proccess, you can check in the BAT file for the dos error level that can be set by the copy program (check each copy program for details), then use a SMTP mailer, like BLAT or my MAILIT util from here, or any other:
But I agree with the previous post, that it is better to send the mail each time on successful copy also and not only when fails. This way if the script does not run at all you'll still notice the absence of the email.
You can also add timing commands like this:
DATE /T >>LOGFILE.TXT
ECHO START COPY>>LOGFILE.TXT
TIME /T >>LOGFILE.TXT
program to copy files...
ECHO END COPY >>LOGFILE.TXT
TIME /T >>LOGFILE.TXT
program to email log files...
Wanted to thank everybody. the xcopy command seems to be doing the trick. Sill messing with the error notification but as long as the data is copying properly!
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.