Link to home
Start Free TrialLog in
Avatar of PeterSinger
PeterSingerFlag for Australia

asked on

Run an app from VB Script with command line options wait till it is done then run another app.

Hi,

I would like to run the following command from a vb script.

"C:\Program Files (x86)\Citrix\ICA Client\wfcrun32.exe" "C:\Users\Public\XenApp Desktop IBAU.ica"

The "C:\Users\Public\XenApp Desktop IBAU.ica" is an argument to the command that will be passed through in the script (it does not change)

I want to monitor the process wfcrun32.exe in the context of the user who is running it as it will be running many times.

Once the process ends, I want to send another command (a logoff)

That is all I need to do and I need to do it all from a vbscript.

Help and Thanks.
Ps
Avatar of X Layer
X Layer
Flag of Slovenia image

You want to logoff from computer?
Try this script:
Dim objShell
Dim Program
Dim Argument

Set objShell = WScript.CreateObject("WScript.Shell")
Program = """C:\Program Files (x86)\Citrix\ICA Client\wfcrun32.exe"""
Argument = """C:\Users\Public\XenApp Desktop IBAU.ica"""

objShell.Run "cmd /c " & Program & " " & Argument, 1, true
objShell.Run "cmd /c shutdown.exe /l"

Open in new window

Avatar of PeterSinger

ASKER

That does not work as the application does not stay alive.  Further, it does not start with the commands used. Any one else?
ASKER CERTIFIED SOLUTION
Avatar of Coralon
Coralon
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial