Home All Groups Group Topic Archive Search About

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

Author
13 Feb 2007 7:33 PM
Bill
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

Author
13 Feb 2007 7:51 PM
Michael W. Ryder
Bill wrote:
Show quoteHide quote
> 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.
Author
13 Feb 2007 8:08 PM
Bill
Michael,

Thanks for the post ....

dir works fine.

Any other thoughts?

Bill

Show quoteHide quote
"Michael W. Ryder" wrote:

> Bill wrote:
> > 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.
>
Author
13 Feb 2007 8:26 PM
Michael W. Ryder
Bill wrote:
> 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.


Show quoteHide quote
> Bill
>
> "Michael W. Ryder" wrote:
>
>> Bill wrote:
>>> 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.
>>
Author
15 Feb 2007 12:00 AM
Bill
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

Show quoteHide quote
"Michael W. Ryder" wrote:

> Bill wrote:
> > 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.
>
>
> > Bill
> >
> > "Michael W. Ryder" wrote:
> >
> >> Bill wrote:
> >>> 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.
> >>
>
Author
15 Feb 2007 1:28 AM
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.

--
Kerry Brown
Microsoft MVP - Shell/User
http://www.vistahelp.ca


Show quoteHide quote
"Bill" <B***@discussions.microsoft.com> wrote in message
news:396AC912-D45C-4E68-8BCA-8C0A70FA0950@microsoft.com...
> 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
>
> "Michael W. Ryder" wrote:
>
>> Bill wrote:
>> > 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.
>>
>>
>> > Bill
>> >
>> > "Michael W. Ryder" wrote:
>> >
>> >> Bill wrote:
>> >>> 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.
>> >>
>>