Solved

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

Posted on 2013-11-08
4
966 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 24

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

Use Case: Protecting a Hybrid Cloud Infrastructure

Microsoft Azure is rapidly becoming the norm in dynamic IT environments. This document describes the challenges that organizations face when protecting data in a hybrid cloud IT environment and presents a use case to demonstrate how Acronis Backup protects all data.

Question has a verified solution.

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

When you upgrade from Windows 8 to 8.1 or to Windows 10 or if you are like me you are on the Insider Program you may find yourself with many 450MB recovery partitions.  With a traditional disk that may not be a problem but with relatively smaller SS…
When you try to extract and to view the contents of a Microsoft Update Standalone Package (MSU) for Windows Vista, you cannot extract the files from the MSU. Here we are going to explain how to extract those hotfix details without using any third pa…
This Micro Tutorial will give you a basic overview of Windows Live Photo Gallery and show you various editing filters and touches to photos you can apply. This will be demonstrated using Windows Live Photo Gallery on Windows 7 operating system.
The viewer will learn how to successfully download and install the SARDU utility on Windows 7, without downloading adware.

776 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