Solved

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

Posted on 2013-06-11
3
500 Views
Last Modified: 2013-06-16
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
0
Comment
Question by:PeterSinger
3 Comments
 
LVL 11

Expert Comment

by:X_layer
ID: 39237273
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

0
 
LVL 4

Author Comment

by:PeterSinger
ID: 39239357
That does not work as the application does not stay alive.  Further, it does not start with the commands used. Any one else?
0
 
LVL 24

Accepted Solution

by:
Coralon earned 500 total points
ID: 39242922
What's the goal here?  x_layer's script should work just fine, (although I'd substitute logoff.exe instead of shutdown.exe -- personal preference).

I have another documented script here http://www.experts-exchange.com/Software/System_Utilities/Remote_Access/Citrix/A_10618-Using-a-startup-script-to-monitor-for-connected-Citrix-Sessions.html that will do pretty much what you are looking for.  (That script would need to be slightly modified to launch the initial ICA file, but conceptually it will accomplish what you want.

Coralon
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Welcome, welcome!  If you are new to the series and haven't been following along, please take a brief moment to review the first three installments: Part 1 (http://www.experts-exchange.com/Programming/Languages/Visual_Basic/VB_Script/A_266-VBScri…
I met Paul Devereux (@pdevereux) today when I responded to his tweet asking “Anybody know how to automate adding files from disk to a folder in #outlook  ?”.  I replied back and told Paul that using automation, in this case scripting, to add files t…
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …
Along with being a a promotional video for my three-day Annielytics Dashboard Seminor, this Micro Tutorial is an intro to Google Analytics API data.

920 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now