Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

Check if app is running (vbscript)

Posted on 2003-03-29
7
Medium Priority
?
309 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
  • 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
Independent Software Vendors: 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!

 

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

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

Question has a verified solution.

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

Computer science students often experience many of the same frustrations when going through their engineering courses. This article presents seven tips I found useful when completing a bachelors and masters degree in computing which I believe may he…
If you are a mobile app developer and especially develop hybrid mobile apps then these 4 mistakes you must avoid for hybrid app development to be the more genuine app developer.
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…
Starting up a Project

569 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