Quantcast
Channel: SQL Server Integration Services forum
Viewing all articles
Browse latest Browse all 24688

Need Bat file to delete file older than 7 Day

$
0
0

Hi All,

My file looks like this

Load201307250717.txt in the format YYYYMMDDHHMM.

Now I have to delete the files which are older than 7 days.

To create the above file my command looks like this

set hh=%time:~-11,2%
set /a hh=%hh%+100
set hh=%hh:~1%
Set TIMESTAMP=%date:~10,4%%date:~4,2%%date:~7,2%%hh%%time:~3,2%%time:~6,2%


copy/Y D:\FOCUS\logs\Load%date:~-4%%date:~4,2%%date:~7,2%.txt "D:\FOCUS\logs\Load%TIMESTAMP%.txt"

dtexec /file "D:\dtsx\LoadIRS.dtsx" /config "D:\config\Load.dtsConfig" >D:\logs\Load%date:~-4%%date:~4,2%%date:~7,2%.txt

Help Needed


Sri.Tummala


Viewing all articles
Browse latest Browse all 24688

Trending Articles