Link to home
Start Free TrialLog in
Avatar of vadimmikhal
vadimmikhal

asked on

Copy .exe file from one computer to many over the network

I need to create batch  file :
1.copy .exe to \\remotepc\Temp folder
2.execute .exe on remote PC

I have to do it from my PC to remote PCs across the network

At present time I do it manually
I can execute .exe with following command

PsExec.exe -s \\name "c:\Temp\windows6.1-KB976932-X64.exe" /quiet
Avatar of Emmanuel Adebayo
Emmanuel Adebayo
Flag of United Kingdom of Great Britain and Northern Ireland image

I used similar process to apply patches to my dmz servers

You can run a simple script as below

Open a notepad and put all the copy  that you want to do as follow.

@ECHO OFF
Echo This section copy to remote PC/Server
xcopy .exe to \\remotepc1\Temp folder
xcopy .exe to \\remotepc2\Temp folder
xcopy .exe to \\remotepc3\Temp folder
                         .
                         .
                         .
Echo Copy completed
Pause

Echo Start executing on remote PC/Server
PsExec.exe -s \\remotepc1 "c:\Temp\windows6.1-KB976932-X64.exe" /quiet
PsExec.exe -s \\remotepc2 "c:\Temp\windows6.1-KB976932-X64.exe" /quiet
PsExec.exe -s \\remotepc3 "c:\Temp\windows6.1-KB976932-X64.exe" /quiet

Echo Executable completed

Pause
Avatar of vadimmikhal
vadimmikhal

ASKER

not sure I follow
Do I have to map drive first
File I want to copy, is on the file server, in shared folder
ASKER CERTIFIED SOLUTION
Avatar of Emmanuel Adebayo
Emmanuel Adebayo
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
You would need a shared folder on the remote PCs because xcopy to \\remotepc1\Temp folder will not work unless "temp folder" is a share name. If you try this it may work \\remotepc1\c$\Temp folder assuming that the default share c$ has not been disabled. How many remote PCs are you working on?