Solved

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

Posted on 2009-04-02
1
724 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
[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
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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

In this post we will learn different types of Android Layout and some basics of an Android App.
What do responsible coders do? They don't take detrimental shortcuts. They do take reasonable security precautions, create important automation, implement sufficient logging, fix things they break, and care about users.
Introduction to Processes
Starting up a Project

627 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