Computing.Net > Forums > Windows XP > Batch File to Rename backups

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

Batch File to Rename backups

Reply to Message Icon

Name: aerw264
Date: February 22, 2005 at 16:17:11 Pacific
OS: Windows XP Pro
CPU/Ram: 2.8GHz/512MB
Comment:

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\old

The 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.



Sponsored Link
Ads by Google

Response Number 1
Name: aerw264
Date: February 23, 2005 at 03:56:27 Pacific
Reply:

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.v2i

but I can't get it to work. can someone please help me?


0

Response Number 2
Name: aerw264
Date: February 23, 2005 at 04:18:06 Pacific
Reply:

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.


0

Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More







Post Locked

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


Go to Windows XP Forum Home


Sponsored links

Ads by Google


Results for: Batch File to Rename backups

Batch file to backup Favourites www.computing.net/answers/windows-xp/batch-file-to-backup-favourites/46469.html

Using BATCH file to backup data www.computing.net/answers/windows-xp/using-batch-file-to-backup-data/66927.html

Batch file to read an ini & more... www.computing.net/answers/windows-xp/batch-file-to-read-an-ini-amp-more/95707.html