Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

run .exe on multiple computers

Status
Not open for further replies.
May 11, 2004
37
US
I am trying to run an .exe on several machines using a dictionary file. When I run this script, the .exe only runs locally on my machine. Can anyone tell me where I went wrong? Many thanks


Option Explicit

Dim objShell, objDictionary, objFSO, objTextFile, i, strNextLine, objItem

Const ForReading = 1

Set objDictionary = CreateObject("Scripting.Dictionary")
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objTextFile = objFSO.OpenTextFile("i:\ipi\assettracker\machines.txt", ForReading)
i = 0
Do Until objTextFile.AtEndOfStream
strNextLine = objTextFile.Readline
objDictionary.Add i, strNextLine
i = i + 1
Loop

For Each objItem in objDictionary
Set objShell = WScript.CreateObject("WScript.Shell")
objShell.Run "I:\IPI\Assettracker\clientcon.exe",7,True
Next


 
Take a look at remote scripting (WSHController object).
Or do a search for psexec.

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top