Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

VB Script Check for active process.

Posted on 2006-11-29
3
Medium Priority
?
719 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 86

Accepted Solution

by:
Mike Tomlinson earned 2000 total points
ID: 18046231
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

Important Lessons on Recovering from Petya

In their most recent webinar, Skyport Systems explores ways to isolate and protect critical databases to keep the core of your company safe from harm.

Question has a verified solution.

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

Today, the web development industry is booming, and many people consider it to be their vocation. The question you may be asking yourself is – how do I become a web developer?
What do responsible coders do? They don't take detrimental shortcuts. They do take reasonable security precautions, create important automation, implement sufficient logging, fix things they break, and care about users.
Progress
Loops Section Overview

885 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