googlemad Posted February 5, 2014 Posted February 5, 2014 I have a folder : G:\stf_info\techs\UNITeDownloads It contains 2 files : Login.csv Gmail.csv Every day (Monday - Friday) I would like to rename the file to Login010101.csv (010101 being the date!) and move it across to the G:\stf_info\techs\UNITeDownloads\Archive sub folder Is there an easy way to do this?
Domino Posted February 5, 2014 Posted February 5, 2014 Batch file as a scheduled task? @echo off set Source=G:\stf_info\techs\UNITeDownloads set Target=G:\stf_info\techs\UNITeDownloads\Archive FOR /f "tokens=1-5 delims=/.:- " %%A in ("%date%") DO ( SET Month=%%A SET Day=%%B SET Year=%%C SET All=%%A%%B%%C ) FOR %%i IN ("%Source%\*.csv") DO ^ COPY "%%i" "%Target%\%%~Ni %All%.csv" 1
ascott2 Posted February 7, 2014 Posted February 7, 2014 If you want it in powershell, this should do you $source = "G:\stf_info\techs\UNITeDownloads\login.csv" $target = "G:\stf_info\techs\UNITeDownloads\Archive" Move-Item $source ("$target\login{0:ddMMyy}.csv" -f(get-date)) and then just setup a scheduled task. 1
googlemad Posted February 17, 2014 Author Posted February 17, 2014 Thanks for the help, the command prompt stuff did the trick for now (Still getting my head round Powershell!)
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now