troubleshooting Question

Copying files across 2 remote servers

Avatar of José Perez
José PerezFlag for Chile asked on
Shell ScriptingMicrosoft DOSWindows OS
11 Comments2 Solutions177 ViewsLast Modified:
Hi,
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
Issue:
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!
ASKER CERTIFIED SOLUTION
Join our community to see this answer!
Unlock 2 Answers and 11 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 2 Answers and 11 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros