473,471 Members | 1,715 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Stopping process

Hi EveryBody:

How can I get the process by its name and stop it ?

Any help will be appreciate

regard's

Husam
Nov 21 '05 #1
3 1010
"Husam" <Hu***@discussions.microsoft.com> schrieb:
How can I get the process by its name and stop it ?


\\\
Dim Processes() As Process = _
Process.GetProcessesByName("notepad")
For Each Process As Process In Processes
Process.CloseMainWindow()
Next Process
///

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>
Nov 21 '05 #2
Hi,

Private Sub btnStartNotepad_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles btnStartNotepad.Click

Process.Start("Notepad")

End Sub

Private Sub btnCloseNotepad_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles btnCloseNotepad.Click

For Each p As Process In Process.GetProcessesByName("Notepad")

p.Kill()

Next

End Sub

Ken

-------------------

"Husam" <Hu***@discussions.microsoft.com> wrote in message
news:D6**********************************@microsof t.com...
Hi EveryBody:

How can I get the process by its name and stop it ?

Any help will be appreciate

regard's

Husam
Nov 21 '05 #3
This exact question was answered by me & Herfried 2 days ago & Herfried/Ken
answered this same question yesterday. So, 3 days in a row the same question
has been asked/answered now. If you would have searched a little you would
have found the solution

Crouchie1998
BA (HONS) MCP MCSE
Nov 21 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: UJ | last post by:
I've got a program that will do some updates to the system. During that time, if a certain program, called a.exe is running, I want to stop the program, do what I need to do and restart the...
12
by: VMI | last post by:
My Windows form has two buttons: "Start" and "Stop". How can I stop the form from doing whatever it is doing without closing the whole application? The "Stop" button would have to stop a process...
0
by: Glen Wolinsky | last post by:
I am creating a Windows service that will check a request queue (database) for pending requests. It will then process each individual request until completed, wait a set time interval and then...
2
by: Danny | last post by:
I have converted serveral vb6 applications to vb.net. One of these applications originally would stop one of my applications by using the findwindow api and using the sendmessage api to close the...
6
by: D | last post by:
I have a simple file server utility that I wish to configure as a Windows service - using the examples of the Python Win32 book, I configured a class for the service, along with the main class...
4
by: bjm | last post by:
I am writing a program that will automate a series of application installations. I want to give the user the option of stopping the program's execution in between installations (for example, give...
6
by: Ed Bitzer | last post by:
You have taught me how to start another program using System.Diagnostics.Process.Start and suggested a good tip site and Google search for future reference. My problem now is how to stop that...
2
by: Steve | last post by:
Hi All, I've been trying to come up with a good way to run a certain process at a timed interval (say every 5 mins) using the SLEEP command and a semaphore flag. The basic thread loop was always...
1
by: raghudr | last post by:
Hi all, I am displaying a splash screen for which i have created a thread.Since my whole project is launched by windows service and that service will start automatically at the start of the...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.