'Transfer files from one server to another using batch script
I have certain files in a folder on my local machine (Windows 8) and I want to transfer them to a remote server (Windows server 2012 R2) using a batch script.
Shown below is the script that I am trying to run but it throws an Invalid drive specification error
.
Note: I am sure that there is a folder called test
in the specified location.
map.bat
xcopy /-y C:\Users\ssubburathinam\Documents\map1\*.* \\192.168.1.11\C:\Users\ssubburathinam\Desktop\test\ /d /c /y
pause
Screenshot of error
I do not know where to put my login credentials in this script as the remote server has login enabled. How can I accomplish this?
Solution 1:[1]
I recommend you to use the "Add a network location" in the main computer, so you can see a new drive letter with the network location. For your try, it might be wrong the share name on the remote computer, if you share a folder, usually is called by:
\\IP_or_name_of_the_remote_server\shared_name
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|---|
Solution 1 | Ricardo Ortega MagaƱa |