1.

Solve : Vb.net Process Path?

Answer»

Hello,

I am TRYING to wirte a program that lists in a listbox all the running program along with their path on the hard drive.
So far I have the following but it returns an error and deosn't show all of them:

Code: [SELECT] Dim PSSS As Process()

Dim P As Process
Psss = System.Diagnostics.Process.GetProcesses


For Each P In Psss
lst.Items.Add(P.MainModule.FileName.ToString)


Next

The name of my listbox is lst

Any Help appreciated

Thanks

Al968
Anyone

Al968What is the error returned?


Just hang tight, ghostdog is really good with stuff like this, so once he arrives you'll be fine."Just hang tight, ghostdog is really good with .vbs, so once he arrives you'll be fine."
This isn't vbs

I get this message :

Code: [Select]System.ComponentModel.Win32Exception: Access Denied
at System.Diagnostics.ProcessManager.OpenProcess(Int32 processId, Int32 access, Boolean throwIfExited)
at System.Diagnostics.NtProcessManager.GetModuleInfos(Int32 processId)
at System.Diagnostics.Process.get_Modules()
at System.Diagnostics.Process.get_MainModule()
at ProcessKiller.Form1.Button2_Click(Object sender, EventArgs e) in C:\A1\Products\ProcessKiller\Form1.vb:line 95
at System.Windows.Forms.Control.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ButtonBase.WndProc(Message& m)
at System.Windows.Forms.Button.WndProc(Message& m)
at System.Windows.Forms.ControlNativeWindow.OnMessage(Message& m)
at System.Windows.Forms.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
Thanks for the info

Al968are you going to kill some PROCESSES? the error you supplied is quite intuitive. Its to do with permissions...make sure the user running the program have the permission to do more privileged tasks other than read (eg kill a process ). If the process is started by say, SYSTEM, a normal user will not be able to kill it...Quote from: Dark Blade on September 09, 2007, 12:45:09 AM

Just hang tight, ghostdog is really good with stuff like this, so once he arrives you'll be fine.
nope.my knowledge is till vb6 too lazy to learn new stuffs Sorry for the late responce

No I just want to list all the running processes

Al968Any one ?

Thanks

Al968Quote from: Clippy on October 09, 2007, 12:50:09 PM
Anyone? LOL




Up and up goes the THREAD count...



Discussion

No Comment Found