xcopy problem – Invalid drive specification – 0 File(s) copied

Recently I started getting the following errors from one of my batch files.

Invalid drive specification
0 File(s) copied

The problem was, that I didn’t have specified drive at all, because I was using UNC path (\\ComputerName\SharedFolder\Resource).

So, xcopy is reporting with the wrong error message.

One possibility is, that it is possible to disable UNC paths in xcopy altogether – see the Microsoft KB Q192808.

In my situation, error was caused by broken network connection. Issuing:
net use \\ComputerName\SharedFolder\Resource /USER:user_name password
right before xcopy, fixed the problem.

This entry was posted in OS and tagged , , . Bookmark the permalink.

2 Responses to xcopy problem – Invalid drive specification – 0 File(s) copied

  1. Bill Westfall says:

    Brilliant, worked like a charm. Thanks !

  2. Anonymous says:

    Also if you were smart like myself and using Windows 7. I opened the command prompt using “”Run as Administrator.” This is a different user than the one you are logged in as and so does not have the mapped drive despite the fact that it is listed if you type the command “net use”Ughh – just start the cmd prompt as yourself when using Win7.

Leave a Reply

Your email address will not be published.


*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>