|
Answer» i need a batch file which will run at a certain time by scheduled tasks of win xp and will backup my certain FOLDER containing several data into a backup folder which is for example c:\dailybackups however, each time batch file copying the data folder must rename with the current date and time.
can i do this? any help is WELCOME to my email
[emailprotected]
os win xp sp2You'd have to do the setting up in scheduled tasks to run the batch, but the batch code would be as follows:
Code: [Select]@echo off set day=%date% set HOUR=%time% md c:\dailybackups\%hour%%day% xcopy c:\MyCertianFolder c:\dailybackups\%hour%%day%
Then add any switches ( /y /k /s etc ) you want at the end of the xcopy line. Just do a xcopy /? for a LIST of the switches.
I did the set for %date% and %time% just incase a second or so goes by between when you make the directory and the COPY happens, then the folder you are looking for won't exist when you copy.
|