Add suffix to file to be backed up?

Dell / LATITUDE D820
June 16, 2010 at 11:19:44
Specs: Microsoft Windows XP Professional, 2.161 GHz / 2046 MB
I want to back up my Firefox profile. I set up a batch file to do it once, but need to know how I can add a suffix (e.g., day, or dd or mmddyyy or a number or a letter) to the file so I can make a weeks worth (or whatever).

Two questions: If I do a weeks worth, and can append day to the file name, then can I put if exist statements like this: [if today is Wed] if exist flvi7abz.defaultwed delete flvi7abz.defaultwed -- before copying on each succeeding Wednesday?

If I put in Startup, how do I keep if from running more than once a day?

No DOS since ME days, so I am not only rusty, but not too familiar with differences between ME & XP batch commands.

See More: Add suffix to file to be backed up?

Report •

June 17, 2010 at 12:07:50
@echo off

Set Day=%Date:~-7,2%
Set Month=%Date:~-10,2%
Set Year=%Date:~-4,4%
Set TodayDate=%Year%%Day%%Month%

Set Hour=%Time:~-11,2%
Call :TrimHour %Hour%
Set Minute=%Time:~-8,2%
Set Second=%Time:~-5,2%
Set TodayTime=%Hour%%Minute%%Second%

Copy %1 %TodayDate%%2
goto :EOF

Set Hour=%*
If %Hour% GEQ 10 then Goto :EOF
Set Hour=0%Hour%
Goto :EOF


Report •
Related Solutions

Ask Question