Link to home
Start Free TrialLog in
Avatar of Michael Williams
Michael WilliamsFlag for United States of America

asked on

Lotusscript to identify whether or not a File is open

I am able to identify whether or not an application (.exe) is running via Lotusscript.

The following identifies whether an application is running:
	Dim vObjectService As Variant, vProcessList As Variant
	Dim bPS180 As Boolean, bWPWIN18 As Boolean

	bPS180 = False
	bWPWIN18 = False
	
	Set vObjectService = GetObject("winmgmts:" & "{impersonationLevel=impersonate}!\\" & "." & "\root\cimv2") 
	Set vProcessList = vObjectService.ExecQuery("Select * from Win32_Process" ) 
	Forall forProcess In vProcessList
		'Process = forProcess.Name
		'Process ID = forProcess.ProcessID
		'Thread Count = forProcess.ThreadCount
		'Page File Size = forProcess.PageFileUsage
		'Page Faults = forProcess.PageFaults
		'Working Set Size = forProcess.WorkingSetSize
		
		'**** Need to verify ps180.exe & wpwin18.exe processes are running
		
		If (Ucase(forProcess.Name) = "PS180.EXE") Then
			bPS180 = True
		End If
		
		If (Ucase(forProcess.Name) = "WPWIN18.EXE") Then
			bWPWIN18 = True
		End If
	End Forall

Open in new window



Is there a way to identify whether or not a File is open?  The file could be a PDF, WK4, WPD etc.
SOLUTION
Avatar of Sjef Bosman
Sjef Bosman
Flag of France image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Michael Williams

ASKER

My apologizes for not coming back in time. Work got a little crazy.

Thank you for pointing me in the right direction Sjef.