I have a simple Batch File for a Windows XP machine that copies a file to a USB drive on either E, F, G or H, all works as it should but I would like a confirmation that the file has been transferred to the drive by means of a Text Message “Files copied to USB drive successfully” what is the best method to do this?
REM ------ Creation of the ZIP file ------
%SupervisorPath%\7-ZipPortable\App\7-Zip\7z a -tzip %BackupPath%\Backup\%FileStamp%.zip %BackupPath%\Backup\
REM ------ Copy the backup file to a USB drive with File Name and Date Stamp -----
IF EXIST E: (echo copying files to USB drive E:
copy %BackupPath%\Backup\%FileStamp%.zip E: /y )
IF EXIST F: (echo copying files to USB drive F:
copy %BackupPath%\Backup\%FileStamp%.zip F: /y )
IF EXIST G: (echo copying files to USB drive G:
copy %BackupPath%\Backup\%FileStamp%.zip G: /y )
IF EXIST H: (echo copying files to USB drive H:
copy %BackupPath%\Backup\%FileStamp%.zip H: /y )
REM ------ Delete the temporary zip file from the backup folder ------
echo Deleting temporary zip file from the backup folder
Del %BackupPath%\Backup\%FileStamp%.zip
New portion of the file is as follows, but it does not move the files
REM ------ Creation of the ZIP file ------
%SupervisorPath%\7-ZipPortable\App\7-Zip\7z a -tzip %BackupPath%\Backup\%FileStamp%.zip %BackupPath%\Backup\
REM ------ Move the backup file to a USB drive with File Name and Date Stamp ------
for %%D in (E F G H) do if exist %%D: (
echo Moving files to USB drive %%D:
move /y "%BackupPath%\Backup\%FileStamp%.zip" %%D: >nul && (
echo Files moved to USB drive successfully
goto :break
)
)
:break