We help IT Professionals succeed at work.
Get Started

Copying files across 2 remote servers

Last Modified: 2017-05-24
amongst all the daily activities I have, there 2 that really takes a lot of time because I have to do it manually :(

Case 1:
I have 1 executable file, "myApp.exe" that needs to be copied  (and overwrite existing one) to a second server:
from \\SERVER1\anyFolder\myApp.exe to \\SERVER2\anyFolder\myApp.exe
I am trying to do it automatically via CMD script using "runas" command but it is not working transparently because it ask me for password, eache time It connects to a different server (14th servers).

"run.bat" file runs:
runas /netonly /user:AMERICAS\myUserName RemoteServer01.bat

"RemoteServer01.bat" file runs:
Copy \\RemoteServer01.americas.local\e$\Tools\RMTool\RMTool.exe \\RemoteServer02.americas.local\e$\Tools\RMTool\RMTool.exe  /B /Z /Y

Open in new window

Case 2:
This one is done via RDP but I would like to do it via cmd if possible:
First step, connect to \\SERVER1\d$\ProductFolder
Second step, using Windows  "Right click / Compress to zipped folder" compress to zip "ProductFolder"
Third, rename resulting zip file adding (manually) current date as a prefix, example of resulting file: "2017-05-05-Oracle.zip"
Fourth step, Move the resulting zip file to \\SERVER1\e$\Backup folder

Thanks a lot!
Watch Question
Top Expert 2015
This problem has been solved!
Unlock 2 Answers and 11 Comments.
See Answers
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE