473,785 Members | 2,847 Online
Bytes | Software Development & Data Engineering Community
+ 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 1031
"Husam" <Hu***@discussi ons.microsoft.c om> schrieb:
How can I get the process by its name and stop it ?


\\\
Dim Processes() As Process = _
Process.GetProc essesByName("no tepad")
For Each Process As Process In Processes
Process.CloseMa inWindow()
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.EventArg s) Handles btnStartNotepad .Click

Process.Start(" Notepad")

End Sub

Private Sub btnCloseNotepad _Click(ByVal sender As System.Object, ByVal e As
System.EventArg s) Handles btnCloseNotepad .Click

For Each p As Process In Process.GetProc essesByName("No tepad")

p.Kill()

Next

End Sub

Ken

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

"Husam" <Hu***@discussi ons.microsoft.c om> wrote in message
news:D6******** *************** ***********@mic rosoft.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
1439
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 program. How can I find out if a.exe is currently running and stop it? TIA - UJ.
12
6084
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 that's being run in another class, not from within the form. Thanks.
0
1427
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 move on to the next one in the list. The processing routine could take 1-2 minutes to finish processing one request. My question is this: If the service is stopped while the process routine is running, how can I make sure the processing of that...
2
4897
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 app. I thought it would be easy enough to convert that api call to use the process class. I can get the process by woProcess() = process.getprocessesbyname("apptoclose"). The use the closemainwindow function. This does get a reference to...
6
8121
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 functions __init__, SvcStop, and SvcDoRun (which contains my server code). After registering the service, I am able to start it with no problems. However, it never stops correctly (net stop returns "service could not be stopped") and service is left...
4
2043
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 the user the chance to stop the program after the second installation before it continues on to the third installation). However, I want the user to be able to start the installations and walk away as well, so I can't ask the user if he wants to...
6
1455
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 program I started. Even if I close my main program this program remains listed in the Task Manager. I promise you I searched but using words like end, stop, close found me lots of information but not my specific need. Appreciate if you would help...
2
3371
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 sitting in the sleep command and not able to be interrupted. When the time came to set the semaphore flag to false (stopping the thread), my program would have to wait up to the entire sleep time to break out of the loop. I have finally found...
1
2535
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 PC and sometimes when i start or restart the PC i have observed that even though the long process is completed splash
0
9645
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9480
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10153
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10093
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
7500
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6740
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5381
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5511
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
3
2880
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.