Celebrate National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

VB Script Check for active process.

Posted on 2006-11-29
3
Medium Priority
?
717 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Monitor input from a computer is usually nothing special.  In this instance it prevented anyone from using the computer.  This was a preconfiguration that didn't work.
If you don't know how to downgrade, my instructions below should be helpful.
Six Sigma Control Plans
Progress

730 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