Reputation: 155
Hi I am making a batch file that will copy a file from the users c drive of a server to the local machine.
This is what i have so far.
net use "\\\Trail01" "trail@1234" "/USER:ashique.sheikh"
XCOPY /Y "\\\Trail01\c:\Users\ashique.sheikh\Desktop\Day2.R" "D:\newfolder"
My server name is \\Trail01
.
The file path is c:\Users\ashique.sheikh\Desktop\Day2.R
.
Upvotes: 1
Views: 1005
Reputation: 825
Try this, you will need the admin credentials for the net use though as the C drive is an administrative share
net use N: \\trail01\c$ trail@1234 /USER:ashique.sheikh
XCOPY /Y "N:\Users\ashique.sheikh\Desktop\Day2.R" "D:\newfolder"
Upvotes: 1