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-KB9769 32-X64.exe " /quiet
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-KB9769
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
Do I have to map drive first
File I want to copy, is on the file server, in shared folder
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
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?
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-KB9769
PsExec.exe -s \\remotepc2 "c:\Temp\windows6.1-KB9769
PsExec.exe -s \\remotepc3 "c:\Temp\windows6.1-KB9769
Echo Executable completed
Pause