Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Batch file to copy from remote desktop to local machine

How do I copy a file from a remote desktop user's drive to my local machine using xcopy or any other protocol?

My server path is \\\Trail01 and the file location is: C:\Users\ashique.sheikh\Desktop\Day2.R

How can I use this is in my batch file?

I have tried this:

net use "\\\Trail01" "Trail01@1234" "/USER:ashique.sheikh"
XCOPY /Y \\\Trail01\c:\users\ashique.sheikh\Desktop\Day2.R  "D:\VMI"

But it doesn't work, it gives a path error.

How can I download this or is there any other way to do it?

like image 663
Ashique Sheikh Avatar asked Mar 18 '16 06:03

Ashique Sheikh


1 Answers

Well, first of all - You can't write \\Trail01\c:\, so you should change it with \\Trail01\c$\

Try something like this...

XCOPY /Y "\\Trail01\c$\users\ashique.sheikh\Desktop\Day2.R" "D:\VMI"

Or perhaps this...

    PushD "\\Trail01\c$\users\ashique.sheikh\Desktop" &&(
XCOPY /Y Day2.R "D:\VMI"
    ) & PopD
like image 157
MadsTheMan Avatar answered Sep 28 '22 17:09

MadsTheMan