Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Try
- 'create an array of Processes
- Dim npProc() As Process
- 'GetProcesses returns an array of processes that are running
- npProc = Process.GetProcesses
- For Each proc As Process In npProc
- 'check the ProcessName to find Notepad
- If proc.ProcessName.Equals("notepad") Then
- MessageBox.Show("Notepad is running")
- 'stop the process that is currently running
- proc.Kill()
- End If
- Next
- Catch ex As Exception
- End Try
Advertisement
Add Comment
Please, Sign In to add comment