For Each p As Process In Process.GetProcessesByName(ProcessRuningName) Try Using searcher As New ManagementObjectSearcher("SELECT CommandLine FROM Win32_Process WHERE ProcessId = " & p.Id) For Each mgmtObj As ManagementObject In searcher.Get() cl = mgmtObj.Item("CommandLine").ToString().Split("""") For x = 0 To cl.Count - 1 Dim FilePath As String = cl(x) If System.IO.Path.GetFileName(FilePath) = FileName Then processFilesRuning.Add(FileName) End If Next Next End Using Catch ex As Win32Exception 'handle error End Try Next
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)