xcopy returns "Invalid drive specification" (w/ out the quotes)

G

Guest

The subject error message occurs when using xcopy to a network mapped drive.

Using the xcopy command with the same parameters, only changing the
destination to another directory on the C: drive, works fine.

(Using the copy option of cut 'n paste also works fine.)

How do I get the xcopy command to work successfully so I can include it in a
batch file to perform backups across my LAN?

Any hint would be appreciated. Thanks!

Bill
 
M

Michael W. Ryder

Bill said:
The subject error message occurs when using xcopy to a network mapped drive.

Using the xcopy command with the same parameters, only changing the
destination to another directory on the C: drive, works fine.

(Using the copy option of cut 'n paste also works fine.)

How do I get the xcopy command to work successfully so I can include it in a
batch file to perform backups across my LAN?

Any hint would be appreciated. Thanks!

Bill


I use XCOPY \\sourcecomputer\C\directory\*.* destination /D /S /R /Y
without any problems. Make sure that you can do a dir listing of the
source computer and directory. There may be a problem with the sharing
or firewalls if you can't.
 
M

Michael W. Ryder

Bill said:
Michael,

Thanks for the post ....

dir works fine.

Any other thoughts?

Can you map the source directory to a network drive? I had to use this
method with one computer when a program that used the network path kept
getting the "Invalid drive" error message. Every other computer in the
office had no problem with the network path.
Another thing you might look at is the route command. Maybe there is an
entry in there that is preventing XCopy from working or you need to
enter one to allow it to work.
 
G

Guest

Thanks for the post ....

Your hints were helpful and after more fussing, the following now works
(using xcopy in an MS-DOS Batch file):

xcopy "C:\Docs & Settings\name\My Docs" "\\tgt_laptop\tgt dir" parms

For some reason (still not understood) the command fails when using a mapped
drive letter for the target_save_location (e.g., Y:).

Regards,
Bill
 
K

Kerry Brown

Mapped drives are always a bad idea in a script or batch file. The drive
mapping could change if a different user is running the file or even if the
current user has changed the mapping. UNC names are the way to go.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top