J
Jimmy Jam
While enumerating processes on Vista, I get access denied errors,
specifically when trying to get the file path.
I am using MS Visual Studio 2008 Professional Edition. I develop on Windows
XP, and it runs fine in that environment.
I have enabled full trust application under security. The target Vista
machine has v2.0 and v3.0 of the framework installed.
The only way I could get the full path information was to run the
application as administrator.
My question is : is there some other way to do this and return all the
information required information ?
I don't want my users to have to do anything other than run the application.
My simple code:
==================================================================
Dim oProcesses() As Process =
System.Diagnostics.Process.GetProcesses()
Dim sPath As String
For Each oProc As Process In oProcesses
If Not (oProc.Id = 0) And Not (oProc.Id = 4) Then
Dim lvi As ListViewItem
lvi = ListView1.Items.Add(oProc.ProcessName)
Try
sPath = oProc.MainModule.FileName
lvi.SubItems.Add(sPath)
Catch ex As Exception
lvi.SubItems.Add("")
End Try
End If
Next
==================================================================
I am a .Net noob.
Thanks for your help,
Jj
specifically when trying to get the file path.
I am using MS Visual Studio 2008 Professional Edition. I develop on Windows
XP, and it runs fine in that environment.
I have enabled full trust application under security. The target Vista
machine has v2.0 and v3.0 of the framework installed.
The only way I could get the full path information was to run the
application as administrator.
My question is : is there some other way to do this and return all the
information required information ?
I don't want my users to have to do anything other than run the application.
My simple code:
==================================================================
Dim oProcesses() As Process =
System.Diagnostics.Process.GetProcesses()
Dim sPath As String
For Each oProc As Process In oProcesses
If Not (oProc.Id = 0) And Not (oProc.Id = 4) Then
Dim lvi As ListViewItem
lvi = ListView1.Items.Add(oProc.ProcessName)
Try
sPath = oProc.MainModule.FileName
lvi.SubItems.Add(sPath)
Catch ex As Exception
lvi.SubItems.Add("")
End Try
End If
Next
==================================================================
I am a .Net noob.
Thanks for your help,
Jj