What's the correct syntax for using an IP address in xcopy?
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.
Related videos on Youtube
Shay Guy
Updated on September 18, 2022Comments
-
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 forservername
-- just the IP address and password. Andxcopy "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 about 10 yearsI 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 about 10 yearsDoesn'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 about 10 yearscan you browse to
\\xxx.xxx.xxx.xxx\
at all? Is Windows File & Printer Sharing enabled on the remote server? -
Shay Guy about 10 yearsNo to the Explorer browsing. Network discovery on the server is turned off; file and printer sharing is turned on.
-
zelanix about 10 yearsIt may be a firewall issue. Try disabling all firewalls on the server and see if that works.
-
JSanchez about 10 yearsWhat if you use the
copy
command, for just one file. Does it work? -
Shay Guy about 10 years
copy
doesn't work. The error message there isThe network path was not found.
-
zelanix about 10 yearsdid 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 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 over 7 years+1. But, mostly correct. The C$ share is for users with administrative access to that machine, or those given explicit access