Identify if a Program is Running

Can I identify whether or not an "exe" is currently running in lotusscript?
Michael WilliamsApplication DeveloperAsked:
Who is Participating?
I'm unfamiliar with lotusscripts, but it seems to have some tiring/reference to Visual Basic,
Potentially you could list processes and the make your determination,
Where are you running the check for a running process versus where the process is?
Michael WilliamsApplication DeveloperAuthor Commented:
Thanks for getting me thinking in the right way.

The following code will loop through all processes that are currently running.

	Dim objWMIService As Variant, colProcessList As Variant

	Set objWMIService = GetObject("winmgmts:" & "{impersonationLevel=impersonate}!\\" & "." & "\root\cimv2") 
	Set colProcessList = objWMIService.ExecQuery("Select * from Win32_Process" ) 
	ForAll objProcess In colProcessList
		Print objProcess.Name
		If (objProcess.Name = "nlnotes.exe") Then
			'MsgBox "Process: " & objProcess.Name
			'MsgBox "Process ID: " & objProcess.ProcessID 
			'MsgBox "Thread Count: " & objProcess.ThreadCount 
			'MsgBox "Page File Size: " & objProcess.PageFileUsage 
			'MsgBox "Page Faults: " & objProcess.PageFaults 
			'MsgBox "Working Set Size: " & objProcess.WorkingSetSize 
		End If
	End ForAll

Open in new window

Michael WilliamsApplication DeveloperAuthor Commented:
Sometimes you just need a little feedback to point you in the right direction.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.