sub isUNCServerRunning if isprocessrunning("UNCServer.exe") then msgbox "uncserver is running" end if msgbox Public Function IsProcessRunning(FileName As String) As Boolean Dim hSnapShot As Long Dim pe32 As PROCESSENTRY32 hSnapShot = CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS, 0) 'create snapshot of process pe32.dwSize = Len(pe32) 'get size of processentry32 Process32First hSnapShot, pe32 'get info about first process Do While Process32Next(hSnapShot, pe32) <> 0 'loop through all processes ' Debug.Print "<" & LCase(pe32.szExeFile) & ">" If InStr(1, "<" & LCase(pe32.szExeFile), "<" & LCase(FileName)) > 0 Then 'process found IsProcessRunning = True End If Loop CloseHandle (hSnapShot) 'close snapshot End Function
Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.
”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.
Our community of experts have been thoroughly vetted for their expertise and industry experience.
This award recognizes an author who contributes the highest volume of original works or content. Recipients of this award produce extremely valuable content that prioritizes accuracy, relevancy, and professionalism.
The Distinguished Expert awards are presented to the top veteran and rookie experts to earn the most points in the top 50 topics.