What's the correct syntax for using an IP address in xcopy?

8,651

You need to replace the \\xxx.xxx.xxx.xxx\C:\Users with \\xxx.xxx.xxx.xxx\C$\Users and your command should work. xcopy only knows about shared folders and the C: drive is shared as C$ automatically.

Share:
8,651

Related videos on Youtube

Shay Guy
Author by

Shay Guy

Updated on September 18, 2022

Comments

  • Shay Guy
    Shay Guy over 1 year

    I want to copy a set of files on a Windows computer to a number of Windows servers I have credentials for without having to go through RDC, theoretically a simple task. For this usage, the appropriate syntax in xcopy is apparently \\servername\..., but I don't think I have anything to put in for servername -- just the IP address and password. And xcopy "C:\Users\myname\Documents\uploadtest.txt" "\\xxx.xxx.xxx.xxx\C:\Users\Public\Public Documents\" just gives the result "Invalid drive specification" instead of requesting a password or anything. Same if the second colon is replaced with a dollar sign. What am I doing wrong?

    • zelanix
      zelanix about 10 years
      I see now that you say you've already tried with C$ and that didn't work either. Can you browse to \\xxx.xxx.xxx.xxx\C$\Users\Public\Public Documents in windows explorer?
    • Shay Guy
      Shay Guy about 10 years
      Doesn't seem to be working. Eventually I got a "Network error" popup: "Windows cannot access \\xxx.xxx.xxx.xxx\C$\Users\Public\Public Documents\".
    • zelanix
      zelanix about 10 years
      can you browse to \\xxx.xxx.xxx.xxx\ at all? Is Windows File & Printer Sharing enabled on the remote server?
    • Shay Guy
      Shay Guy about 10 years
      No to the Explorer browsing. Network discovery on the server is turned off; file and printer sharing is turned on.
    • zelanix
      zelanix about 10 years
      It may be a firewall issue. Try disabling all firewalls on the server and see if that works.
    • JSanchez
      JSanchez about 10 years
      What if you use the copy command, for just one file. Does it work?
    • Shay Guy
      Shay Guy about 10 years
      copy doesn't work. The error message there is The network path was not found.
    • zelanix
      zelanix about 10 years
      did you check the firewalls? This is clearly a network issue. You need to be able to browse to the path in Windows Explorer first. Before that, nothing else will work, I guarantee it.
    • JSanchez
      JSanchez about 10 years
      @ShayGuy: See the answer I provided. Without the sharing protocol enabled, you won't be able to share files, even if your firewall rules are configured properly.
  • Keltari
    Keltari over 7 years
    +1. But, mostly correct. The C$ share is for users with administrative access to that machine, or those given explicit access