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
493 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
Comment Utility
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
Comment Utility
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 23

Accepted Solution

by:
Coralon earned 500 total points
Comment Utility
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

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

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…
Not long ago I saw a question in the VB Script forum that I thought would not take much time. You can read that question (Question ID  (http://www.experts-exchange.com/Programming/Languages/Visual_Basic/VB_Script/Q_28455246.html)28455246) Here (http…
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

743 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

13 Experts available now in Live!

Get 1:1 Help Now