Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
Hi,
I've got a very simple backup solution which has worked for years. I know a lot of other people that use it because it works great and is extremely simple to implement. It's just a simple batch file (backup.bat) which uses the XCOPY command to backup directories to a 2nd hard disk (USB).The only weakness is that if you stick something else in the computer, like a pen drive it may screw up the drive letter assignments. So if you hard disk is bumped out of position, e.g. from e: to f: then your script doesnt work.
Anyone know how to fix this whilst retaining the batch file solution?
Thanks for your time guys.

The way to avoid "bumped" drive letters is to assign the USB drive a letter which is "out of harm's way".
I assign mine u: so I've got a dozen or more in between for flash drives etc.
You could put into the front of your BAT code like:
vol r:
if not errorlevel 1 goto :start
vol s:
if not errorlevel 1 goto :start
vol t:
if not errorlevel 1 goto :start
[and so on]But it seems pretty mickey-mouse. I think assigning the drive letter is better.
If at first you don't succeed, you're about average.M2

I use this system, but as I back up to a number of destinations, which may or may not be present at any time, I insert a test file on each destination and check for it's presence, as follows:-
........................................
echo Searching for MiniDisk. Please Wait............
if exist d:\256Mb.tst set minidsk=D
if exist d:\256Mb.tst goto bakMinidsk
if exist e:\256Mb.tst set minidsk=E
if exist e:\256Mb.tst goto bakMinidsk
if exist f:\256Mb.tst set minidsk=F
if exist f:\256Mb.tst goto bakMinidsk
if exist g:\256Mb.tst set minidsk=G
if exist g:\256Mb.tst goto bakMinidsk
if exist h:\256Mb.tst set minidsk=H
if exist h:\256Mb.tst goto bakMinidsk
if exist i:\256Mb.tst set minidsk=I
if exist i:\256Mb.tst goto bakMinidskgoto nominidsk
:bakMinidsk
cls
echo.
echo.
echo.
echo Preparing to copy changed data files from Main Machine to Minidrive on Drive %minidsk%:
echo.
echo.
c:\windows\system32\xcopy c:\data\*.* %minidsk%:\data /s/e/d/y
echo.
echo.
echo Backup to Minidrive completed.
echo.
pause
goto baktpad1:nominidsk
cls
echo.
echo.
echo.
echo MiniDisk Drive not found.
echo Backup to MiniDisk Drive will not be done this time.
pause.......................................
I hope that comes out OK - some of the lines seem to have got extra splits in them.

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

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