Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

How do I use psexec or a vbs script to run 2 .exe files on remote computers?

Posted on 2009-04-02
1
Medium Priority
?
726 Views
Last Modified: 2013-11-10
I need help using psexec or a vbs script to copy and run 2 executables files on 200 remote computers. The two files are required to update an existing client application.
The first exe file stops the  running process of the application. The second exe file updates the client application.  Both exe files have to first be copied to the c:\program files\application path
on the remote computers. I've tried using 3 separate psexec commands to accomplish this but it isn't working; the files get copied and I get exit 0 on the next 2 steps but the updated application doesn't launch properly.  If I copy the files and run the 2 exe files from the console of a computer it works fine. I'd like to do this with one script. The comands that I use are below.
1- psexec @computernames.txt -c c:\program files\application path\file.exe
2-psexec @computernames.txt c:\program files\application path\stop_process.exe
3-psexec @compternames.txt c:\program files\application path\update_app.exe
0
Comment
Question by:briehill
1 Comment
 
LVL 6

Accepted Solution

by:
Justin_W_Chandler earned 750 total points
ID: 24054736
psexec @computernames.txt -c -w "c:\program files\application path" PROGRAM.EXE

- OR -

:: copy these two lines into WHATEVER.BAT and run it. it assumes PROGRAM.EXE is in the local folder
for /f %%A in (computernames.txt) do copy PROGRAM.EXE "\\%%A\c$\program files\application path"
for /f %%A in (computernames.txt) do psexec -w "\\%%A\c$\program files\application path" PROGRAM.EXE
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

With User Account Control (UAC) enabled in Windows 7, one needs to open an elevated Command Prompt in order to run scripts under administrative privileges. Although the elevated Command Prompt accomplishes the task, the question How to run as script…
If you are a mobile app developer and especially develop hybrid mobile apps then these 4 mistakes you must avoid for hybrid app development to be the more genuine app developer.
In this fifth video of the Xpdf series, we discuss and demonstrate the PDFdetach utility, which is able to list and, more importantly, extract attachments that are embedded in PDF files. It does this via a command line interface, making it suitable …
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

877 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