Solved

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

Posted on 2013-11-08
4
986 Views
Last Modified: 2013-11-11
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
0
Comment
Question by:vadimmikhal
  • 2
4 Comments
 
LVL 17

Expert Comment

by:Emmanuel Adebayo
ID: 39634082
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
0
 

Author Comment

by:vadimmikhal
ID: 39634134
not sure I follow
Do I have to map drive first
File I want to copy, is on the file server, in shared folder
0
 
LVL 17

Accepted Solution

by:
Emmanuel Adebayo earned 500 total points
ID: 39634166
No you don't need to map drive. I guess the file you are copy is from your PC. If the files are on the remote server, all you need to do is

Xcopy <file> <Source> <destination>

Let say the files you want to copy are on server1\folder\, your batch would become

@ECHO OFF
Echo This section copy to remote PC/Server
xcopy server1\folder\<.exe> \\remotepc1\Temp folder
xcopy server1\folder \\remotepc2\Temp folder
xcopy server1\folder \\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
0
 
LVL 25

Expert Comment

by:Lionel MM
ID: 39635619
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?
0

Featured Post

Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Previous versions always empty 9 53
BATCH to EXE Converter 2 39
Create .bat File 16 37
HP Stream laptop logging in issue 15 36
By default the complete memory dump option is disabled in windows . If we want to enable the complete memory dump for a diagnostic purpose, we have a solution for it. here we are using the registry method to enable this.
When you try to share a printer , you may receive one of the following error messages. Error message when you use the Add Printer Wizard to share a printer: Windows could not share your printer. Operation could not be completed (Error 0x000006…
This Micro Tutorial will teach you the basics of configuring your computer to improve its speed. It will also teach you how to disable programs that are running in the background simultaneously. This will be demonstrated using Windows 7 operating…
With the advent of Windows 10, Microsoft is pushing a Get Windows 10 icon into the notification area (system tray) of qualifying computers. There are many reasons for wanting to remove this icon. This two-part Experts Exchange video Micro Tutorial s…

830 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question