Wednesday, August 6, 2014

DOS Batch File Copy Cleaner

The purpose for this script is to copy any file type with the latest modified date to a network share.
==Old School Style==

::**
REM *** Delete previously copied file from destination directory ***
DEL \\networkshare\d$\SqlBackup\*.bak
REM *** Copy the latest .xxx file to a new directory ***
DIR DatabaseFile*.bak /o-d /b > newestbak.lst
SET /p latest=< newestbak.lst
COPY %latest% \\networkshare\d$\SqlBackup\
DEL newestbak.lst
::**
EXIT