Photo Gallery Member List Search Calendars FAQ Ticket List Log Out


find out if programm is running with VBScript

 
Logged in as: Guest
arrSession:exec spGetSession 2,2,23975
 Active Users: There are 0 members and 0 guests.
 Users viewing this topic: none
 

 

 
  
  Printable Version
All Forums >> [Scripting] >> WSH & Client Side VBScript >> find out if programm is running with VBScript
  Do you like VisualBasicScript.com? Link to us and help spread the word about our forum. Thanks!
Page: [1]
Login
Message << Older Topic   Newer Topic >>
 find out if programm is running with VBScript - 7/24/2005 3:46:24 AM   
  XratedFozzibaer

 

Posts: 2
Score: 0
Joined: 7/24/2005
Status: offline
Hi there,

I thought about a VBScript that can figure out if a programm is running and afterwards, if the programm is not running, start it.
Is that possible, for e.g. with DivX Player or any other specific application running on windows?

Some help or infos would be very welcome!

Greetz, Alex

One of endless reasons for using Firefox
 
 
Post #: 1
 
 RE: find out if programm is running with VBScript - 7/24/2005 8:19:31 AM   
  didorno

 

Posts: 361
Score: 0
Joined: 2/12/2005
From:
Status: offline
The next code checks the running of a process Database.exe

strComputer = "."
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
Set colProcesses = objWMIService.ExecQuery _
("Select * from Win32_Process Where Name = 'Database.exe'")
If colProcesses.Count = 0 Then
Wscript.Echo "Database.exe is not running"
Else
Wscript.Echo "Database.exe is running."
End If

The next code will start your program :

Set WshShell = WScript.CreateObject("WScript.Shell")
Return = WshShell.Run("Database.exe", 1, true) You can try to combine these.

Good luck !

_____________________________

Regular Expression ? I (L+o{1,}v{1,3}e\s)+[iI]t!$

(in reply to XratedFozzibaer)
 
 
Post #: 2
 
 RE: find out if programm is running with VBScript - 7/24/2005 11:16:49 AM   
  XratedFozzibaer

 

Posts: 2
Score: 0
Joined: 7/24/2005
Status: offline
Yeah, that's exactly what I needed!

The internet and the people her are great!

Nothing is impossible!!!

Thanks!

(in reply to didorno)
 
 
Post #: 3
 
 
 
  

If you found our site useful please link to us <a href="http://www.visualbasicscript.com">VisualBasicScript.com</a>.
All Forums >> [Scripting] >> WSH & Client Side VBScript >> find out if programm is running with VBScript Page: [1]
Jump to:





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts