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
507 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 25

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

Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

Question has a verified solution.

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

Well hello again!  Glad to see you've made it this far without giving up.  In this, the fourth installment of my popular series, I'm going to cover functions and subroutines, what they are, and why they are useful.  Just in case you stumbled onto th…
This script will sweep a range of IP addresses (class c only, 255.255.255.0) and report to a log the version of office installed. What it does: 1.)      Creates log file in the directory the script is run from (if it doesn't already exist) 2.)      Sweep…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

828 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