?
Solved

Check if app is running (vbscript)

Posted on 2003-03-29
7
Medium Priority
?
306 Views
Last Modified: 2010-04-17
Small question. How do you check is an app is running and when not return false in VBscript?
0
Comment
Question by:malfunc_eddie
[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
  • 4
  • 2
7 Comments
 
LVL 1

Expert Comment

by:Tabog
ID: 8231003
You want to check if a VBscript is running... or a normal windows application ?
0
 

Author Comment

by:malfunc_eddie
ID: 8231096
a normal windows application(notepad.exe,calc.exe....)
0
 
LVL 12

Accepted Solution

by:
jyokum earned 80 total points
ID: 8231714
Set obj = GetObject(, "Excel.Application")
If Err = 0 Then
    ' Excel is running
Else
    ' Excel is NOT running
End If
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 

Author Comment

by:malfunc_eddie
ID: 8231975
it doesn't work jyokum.  I get an error


ActiveX-part can not create object:"GetObject" :-(

keep trying (please)
0
 
LVL 12

Expert Comment

by:jyokum
ID: 8232342
I wrote a dll that will do the detection, I can send it to you if you want it.
0
 

Author Comment

by:malfunc_eddie
ID: 8233199
thanks

=> malfunction_eddy@msn.com
0
 

Author Comment

by:malfunc_eddie
ID: 8241536
this also works

Set WshShell = WScript.CreateObject("WScript.Shell")

Set locator = CreateObject("WbemScripting.SWbemLocator")
Set service = locator.ConnectServer()
Set props = service.ExecQuery("select name, description from Win32_Process where name = 'program.exe'")
num = props.Count

If num > 0 Then
   'Program is running
Else
   'Program is not running
End If

Set WSHShell = Nothing
 
0

Featured Post

Enroll in August's Course of the Month

August's CompTIA IT Fundamentals course includes 19 hours of basic computer principle modules and prepares you for the certification exam. It's free for Premium Members, Team Accounts, and Qualified Experts!

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.
Q&A with Course Creator, Mark Lassoff, on the importance of HTML5 in the career of a modern-day developer.
Six Sigma Control Plans
Starting up a Project

764 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