Link to home
Start Free TrialLog in
Avatar of GST-GRIDTECH
GST-GRIDTECHFlag for United States of America

asked on

Accessing uNC paths from CMD line/bat file

Hi.
I'm might be missing something here.
However, we use a batch file that easily does a
Xcopy "\\serverName\path1\path2\*" "C:\programs\pathlocal1\pathlocal2" /s /e /y

On widows 7
But doesn't work on
Windows 10.

Am I missing some basic understanding here.

I guess I could just map it but wanted to understand why it works in windows7 but doesn't work in windows10

Thank you
Avatar of CES
CES

Not sure if it matters but, are you using capital letters for the switches?

what's the error you get?
As commented above it should work.
Please post the screenshot of the error.
ASKER CERTIFIED SOLUTION
Avatar of GST-GRIDTECH
GST-GRIDTECH
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Glad to know you sorted by yourself
FWIW, you can also use PUSHD and POPD, which maps the drive letter to the path and makes it current. Then, POPD releases the mapped drive.

pushd "\\serverName\path1\path2"
Xcopy . "C:\programs\pathlocal1\pathlocal2" /s /e /y
popd

Open in new window

Avatar of GST-GRIDTECH

ASKER

After a little more troubleshooting and research I was able to find the solution