0

I try to run .bat file from remote desktop.

I do it by run the next command:

net use m: \\the-ip-of-the-remote-computer mypassword /myuser
// Execution works well

then, I try to xcopy from the remote desktop to my computer. So I write this:

net use t: \\the-ip-of-the-remote-desktop mypassword /myuser
xcopy \\the-ip-of-the-remote-computer my-libary

But in some cases, this command is not execute well.

I also try this, and it doesn't work:

net use m: \\the-ip-of-the-remote-desktop mypassword /myuser
xcopy net use t: \\the-ip-of-the-remote-computer mypassword /myuser my-libary

and It also doesn't work.

What can be the problem.

Adam Sh
  • 8,137
  • 22
  • 60
  • 75
  • It looks like you miss the share name in your examples: net use t: \\yourpc\sharename yourpassword /user:yourusername In what cases does it fail? any errors? – rene Dec 14 '12 at 09:41
  • @rene: I added the share name, It doesn't work. There is no error (the .bat file works well locally). – Adam Sh Dec 14 '12 at 09:49

1 Answers1

0

Try mapping the share, then change to that drive before using xcopy

net use M: \\the-ip-of-the-remote-computer mypassword /myuser
pushd M:\
xcopy folder\filetocopy C:\yourcdrivefolder
Bali C
  • 30,582
  • 35
  • 123
  • 152