Nadeemj
asked on
Hi all need help
Hi All I need to make a program wich will detect all applications running for example in Taskmanager and close them or kill them.
I am using vb.net
Pls help
thnks
I am using vb.net
Pls help
thnks
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
To kill an application process:
---
Dim proc As System.Diagnostics.Process
Dim pList() As Process
pList = Process.GetProcessesByName ("notepad" )
For Each proc In pList
Dim resp As MsgBoxResult
resp = MsgBox("Terminate " & proc.ProcessName & "?", MsgBoxStyle.YesNo, "Terminate?")
If resp = MsgBoxResult.Yes Then
proc.Kill()
End If
Next
---
---
Dim proc As System.Diagnostics.Process
Dim pList() As Process
pList = Process.GetProcessesByName
For Each proc In pList
Dim resp As MsgBoxResult
resp = MsgBox("Terminate " & proc.ProcessName & "?", MsgBoxStyle.YesNo, "Terminate?")
If resp = MsgBoxResult.Yes Then
proc.Kill()
End If
Next
---
In your case, you would use GetProcesses() instead of GetProcessesByName().
ASKER
Guys I know how to get processes and kill them. What i dont know how to do is kil only the Appications listed in task manager, automaticaly without having to have the user choosing the application
thnks
thnks
For Each p As Process In AllProcesses
p.Kill()
Next