Solved

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

Posted on 2013-11-08
4
1,059 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 18

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 18

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

Optimize your web performance

What's in the eBook?
- Full list of reasons for poor performance
- Ultimate measures to speed things up
- Primary web monitoring types
- KPIs you should be monitoring in order to increase your ROI

Question has a verified solution.

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

New Windows 7 Installations take days for Windows-Updates to show up and install. This can easily be fixed. I have finally decided to write an article because this seems to get asked several times a day lately. This Article and the Links apply to…
When you start your Windows 10 PC and got an "Operating system not found" error or just saw  "Auto repair for startup" or a blinking cursor with black screen. A loop for Auto repair will start but fix nothing.  You will be panic as there are no back…
This video Micro Tutorial explains how to clone a hard drive using a commercial software product for Windows systems called Casper from Future Systems Solutions (FSS). Cloning makes an exact, complete copy of one hard disk drive (HDD) onto another d…
The Task Scheduler is a powerful tool that is built into Windows. It allows you to schedule tasks (actions) on a recurring basis, such as hourly, daily, weekly, monthly, at log on, at startup, on idle, etc. This video Micro Tutorial is a brief intro…
Suggested Courses

630 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