• Notice regarding image hosts and attachments. See here.

Advice regarding my batch script?

Soldato
Joined
23 Mar 2007
Posts
2,553
Location
Essex
Hi all just looking for some advice regarding my batch script i have created. I have added a goto menu to the script so it will ask which backup drive i want to backup files to. I have set it to go to backup drive 1 upon the number 1 being pressed and backup drive 2 upon the number 2 being pressed. The problem i have is whenever i press the number 2 option to backup to backup drive 2 it seems to go to the backup drive 1 menu instead of the backup drive 2 menu :confused:

Sorry if i sound confusing, i have put the script below for you to see.

Hope someone might be able to help



ECHO WHICH BACKUP DRIVE WOULD YOU LIKE TO BACKUP YOUR FILES TO?

ECHO ------------------
ECHO BACKUP DRIVES LIST
ECHO ------------------
ECHO 1. BACKUP DRIVE 1
ECHO 2. BACKUP DRIVE 2

ECHO.

SET /P N=TYPE 1 FOR BACKUP DRIVE 1 OR 2 FOR BACKUP DRIVE 2 THEN PRESS ENTER:
IF "%N%"=="1" GOTO BACKUP DRIVE 1 WIZARD
IF "%N%"=="2" GOTO BACKUP DRIVE 2 WIZARD

:BACKUP DRIVE 1 WIZARD

ECHO ----------------
ECHO MY MOVIES BACKUP
ECHO ----------------

ECHO THE FOLLOWING FILES WILL BE COPIED FROM MEDIA DRIVE 1 TO BACKUP DRIVE 1
XCOPY "D:\My Movies" "\\LIAM-MEDIA\Backup Drive 1\Movies" /L /D /Y /S
PAUSE
XCOPY "D:\My Movies" "\\LIAM-MEDIA\Backup Drive 1\Movies" /S /D /Y
ECHO.

ECHO THE FOLLOWING FILES WILL BE COPIED FROM MEDIA DRIVE 2 TO BACKUP DRIVE 1
XCOPY "F:\My Movies" "\\LIAM-MEDIA\Backup Drive 1\Movies" /L /D /Y /S
PAUSE
XCOPY "F:\My Movies" "\\LIAM-MEDIA\Backup Drive 1\Movies" /S /D /Y
ECHO.


:BACKUP DRIVE 2 WIZARD

ECHO ----------------
ECHO MY MOVIES BACKUP
ECHO ----------------

ECHO THE FOLLOWING FILES WILL BE COPIED FROM MEDIA DRIVE 1 TO BACKUP DRIVE 2
XCOPY "D:\My Movies" "\\LIAM-MEDIA\Backup Drive 2\Movies" /L /D /Y /S
PAUSE
XCOPY "D:\My Movies" "\\LIAM-MEDIA\Backup Drive 2\Movies" /S /D /Y
ECHO.

ECHO THE FOLLOWING FILES WILL BE COPIED FROM MEDIA DRIVE 2 TO BACKUP DRIVE 2
XCOPY "F:\My Movies" "\\LIAM-MEDIA\Backup Drive 2\Movies" /L /D /Y /S
PAUSE
XCOPY "F:\My Movies" "\\LIAM-MEDIA\Backup Drive 2\Movies" /S /D /Y
ECHO.
 
I think i might have found the issue, it didnt seem to like the spaces on the goto menus so i just changed backup drive 1 wiazrd to drive1 and backup drive 2 wizard to drive2 and it seems to now go to the correct menu
 
Thanks both of you much appreciated, i might look into robocopy as i know xcopy is a little dated now :)

One thing i would like to know if you might be able to lend a hand. Bascially i now have 2 backup drives and i wanted to carry on backing my movies up to my new backup drive as the old one is now full. You can see the basic copy command i use to copy my movies to my old backup drive whcih was fine but what i would like to do is be able to copy only the new movies i add to my collection to the new backup drive but i cant seem to find a way of doing it. If i setup the new drive with the script above for example its going to copy all my movies again that i already have on the other backup drive from my media machine, all i want is the ones that are not currently on the old backup drive to be copied to the new backup drive

Is this possible do you think?
 
Yea i know pal lol i just bought a 2tb external hd just transfering 800gb of files now gonna take 5 hrs lol typical slow usb 2 external drives hey!
 
Back
Top Bottom