I want to use xcopy
on a network path. I actually do.
The problem is that I wanted to use an /exclude
option. But the file would be in a network path. But the network path has spaces (s:\my path
).
So this is what I'm using and it's working right now without /exclude
(S:
is a mapped network file):
xcopy "S:\TI\My Path" "C:\Path" /S /I /D /Q /Y
I've tried adding an /exclude
file locally and it works fine (figured out I must use the 8.3 name):
xcopy "S:\TI\My Path" "C:\Path" /S /I /D /Q /Y /exclude:c:\MyConf~1\cfg.txt
But the same didn't work when I move to a network path. I think the main reason is that network path doesn't have a 8.3 name according to dir /x
.
xcopy "S:\TI\My Path" "C:\Path" /S /I /D /Q /Y /exclude:s:\MyConf~1\cfg.txt
Impossible to read the file: s:\MyConf~1\cfg.txt
The line above was translated by me from Brazilian Portuguese and may not be exactly what xcopy
returns. But I think you get it.
I've tried to use a not mapped version, which is not practical actually and didn't work.
xcopy "S:\TI\My Path" "C:\Path" /S /I /D /Q /Y /exclude:\\server\MyConf~1\cfg.txt
Is there a way I can achieve this with xcopy
? Is there any equivalent who does not need an install in every PC?