Solved

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

Posted on 2009-04-02
1
718 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 250 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

Space-Age Communications Transitions to DevOps

ViaSat, a global provider of satellite and wireless communications, securely connects businesses, governments, and organizations to the Internet. Learn how ViaSat’s Network Solutions Engineer, drove the transition from a traditional network support to a DevOps-centric model.

Question has a verified solution.

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

Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
Use this article to create a batch file to backup a Microsoft SQL Server database to a Windows folder.  The folder can be on the local hard drive or on a network share.  This batch file will query the SQL server to get the current date & time and wi…
In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…

821 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