Computing.Net > Forums > Windows XP > xcopy - avoiding invalid drive spec

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.

xcopy - avoiding invalid drive spec

Reply to Message Icon

Name: cl0306
Date: March 11, 2006 at 04:05:50 Pacific
OS: xp home
CPU/Ram: XP2400/512MB
Comment:

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.



Sponsored Link
Ads by Google

Response Number 1
Name: Mechanix2Go
Date: March 11, 2006 at 04:20:44 Pacific
Reply:

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


0

Response Number 2
Name: oldfogey
Date: March 11, 2006 at 10:27:37 Pacific
Reply:

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 bakMinidsk

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


0

Response Number 3
Name: cl0306
Date: March 13, 2006 at 15:27:17 Pacific
Reply:

Thanks guys, that's so much help!!!


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: xcopy - avoiding invalid drive spec

Format C invalid drive speciation www.computing.net/answers/windows-xp/format-c-invalid-drive-speciation/143142.html

Invalid drive specififcation on Windows www.computing.net/answers/windows-xp/invalid-drive-specififcation-on-windows-/31647.html

Invalid Drive Specification www.computing.net/answers/windows-xp/invalid-drive-specification/38455.html