0

I would like to create a bat. file on my computer who is connected to another computer using nothing but a switch, there is no server. the remote desktop has a static ip a username and a password which are known to me.

I saw and used this code in the bat. file on my computer:

net use "\172.17.0.27" typePassword /user:domain\typeUsername
XCOPY "\172.17.0.27\C$\Reports\" "C:\Trades_Backup" /y /d

it did not work did not copy any files

Alex K.
  • 171,639
  • 30
  • 264
  • 288
  • Were you to follow the usage information, visible by entering `net use /?` at the Command Prompt, you'd note that there's something missing from your command line: `NET USE [devicename | *] [\\computername\sharename] [password] [/USER:domainname\username]`! – Compo Aug 02 '18 at 14:07
  • With the `NET USE` command you need to specify the share as well. In this case it is the administrative share of the C: drive on the remote computer. So add the `C$` to the net use command. – Squashman Aug 02 '18 at 18:23
  • Possible duplicate of [Mapping a network drive without hardcoding a drive letter in a batch file](https://stackoverflow.com/questions/3716422/mapping-a-network-drive-without-hardcoding-a-drive-letter-in-a-batch-file) – Squashman Aug 02 '18 at 18:23

0 Answers0