Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
I have Norton GHost to do backups between three computers, and I need help making a batch file that renames the backup files that Ghost creates to the time and date they were created. I could replace this with a batch that simply names them to today's date as I will be running this file as a scheduled task the day the backup is created. The batch file I'm looking for should:
rename the files to match the date they were made
copy them to \\wielinator\backups\XP
move them to C:\backups\XP\oldThe files I want this done to are in C:\backups\XP\New
THis is all part of a large scheduling, organizing, and copying plan that keeps three computers backed up and lets them do the backups when I don't have to worry about someone getting ticked off because their stuff got lost when they were working on it. I have the copy command with all the echo labeling I need:ECHO OFF
ECHO This batch file copies the C drive backup files to the WIelinator
ECHO READY TO BACKUP
ECHO backing up...
COPY "C:\BACKUPS\XP\NEW" "\\WIELINATOR\BACKUPS\XP"
ECHO All done!I think I can do the move part of the file, but I can't get the renaming to work. I also tried the suggestion at http://www.pcmag.com/article2/0%2C4...386947%2C00.asp but it would not work. I'm sure theres someone here who really knows how to make a batch file that can help me.

I came up with this code:
@ECHO OFF
FOR /F "tokens=1-4 delims=/ " %%I IN ('DATE /t') DO SET mydate=%%J-%%K-%%L
ECHO The value is "%mydate%"
ren C:\backups\XP\New\C_drive001.v2i %mydate%.v2i
copy C:\backups\XP\New\%mydate%_Cdrive.v2i \\wielinator\backups\XP\Old\%mydate%_Cdrive.v2i
move C:\backups\XP\New\%mydate%_Cdrive.v2i C:\backups\xp\old\%mydate%_Cdrive.v2ibut I can't get it to work. can someone please help me?

I just found this code:
For /F "tokens=2-4 delims=. " %%A in ('Date /T') Do Rename C:\backups\XP\new\C_driveoo1.v2i %%A%%B%%C_drive001.v2i
but I need some help getting it to output the date with hyphens instead of slashes.

![]() |
![]() |
![]() |

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.
| Ads by Google |