Solved

VB Script Check for active process.

Posted on 2006-11-29
3
707 Views
Last Modified: 2010-08-05
Hello Experts

Could someone help me with a script issue. Down bellow i have a script for run a installation with higher privileges. I want a function for checking that msiexec is running and not end the script until msiecexe.exe process is shutdown.

Option explicit
dim oShell
set oShell= Wscript.CreateObject("WScript.Shell")
oShell.Run "runas /user:ad\lcladmin ""msiexec /i c:\zentest\zfdagent.msi /qb!"""
WScript.Sleep 100
oShell.Sendkeys "Password~"
WScript.Quit

Thanks

Mattias
0
Comment
Question by:kihl71
3 Comments
 
LVL 85

Accepted Solution

by:
Mike Tomlinson earned 500 total points
Comment Utility
Not sure if this will work with "runas"...

You could try the Exec() method instead so that you can poll the running state:
http://msdn2.microsoft.com/en-us/library/ateytk4a.aspx

The example in the above link shows how to loop until the app is complete.
0

Featured Post

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Whether you’re a college noob or a soon-to-be pro, these tips are sure to help you in your journey to becoming a programming ninja and stand out from the crowd.
Although it can be difficult to imagine, someday your child will have a career of his or her own. He or she will likely start a family, buy a home and start having their own children. So, while being a kid is still extremely important, it’s also …
An introduction to basic programming syntax in Java by creating a simple program. Viewers can follow the tutorial as they create their first class in Java. Definitions and explanations about each element are given to help prepare viewers for future …
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

762 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

14 Experts available now in Live!

Get 1:1 Help Now