Solved

VB Script Check for active process.

Posted on 2006-11-29
3
714 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 500 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

What Is Transaction Monitoring and who needs it?

Synthetic Transaction Monitoring that you need for the day to day, which ensures your business website keeps running optimally, and that there is no downtime to impact your customer experience.

Question has a verified solution.

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

In this post we will learn different types of Android Layout and some basics of an Android App.
With User Account Control (UAC) enabled in Windows 7, one needs to open an elevated Command Prompt in order to run scripts under administrative privileges. Although the elevated Command Prompt accomplishes the task, the question How to run as script…
In this fifth video of the Xpdf series, we discuss and demonstrate the PDFdetach utility, which is able to list and, more importantly, extract attachments that are embedded in PDF files. It does this via a command line interface, making it suitable …
With the power of JIRA, there's an unlimited number of ways you can customize it, use it and benefit from it. With that in mind, there's bound to be things that I wasn't able to cover in this course. With this summary we'll look at some places to go…

729 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