Sorry if the question wasn't clear, it'd be too much to type if it were.
I found some code a few days ago that reads the executable path of every process but returns an error when trying to get certain processes. I didn't make all of this code :
I need to know exactly what causes it to return "n/a" because if I were to make present to me the information from, for example, a messagebox, some processes will return "n/a" and I need it to not do that or figure out another way of grabbing the executable paths.
I don't want just the filename, anyone can bypass that and if it has the same name as "explorer.e xe" for example, that could cause a problem.
I found some code a few days ago that reads the executable path of every process but returns an error when trying to get certain processes. I didn't make all of this code :
Code:
Dim example as integer
Dim file2 As String
For Each p As Process In Process.GetProcesses
Try
file2 = p.Modules(0).FileName
Catch ex2 As System.ComponentModel.Win32Exception
file2 = "n/a"
End Try
If file2 = "C:\example.exe" Then
example += 1
End If
Next
I don't want just the filename, anyone can bypass that and if it has the same name as "explorer.e xe" for example, that could cause a problem.
Comment