473,396 Members | 1,689 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

End process from Task Manager using programming?

LBT
Hi experts,

Sometimes there is some "unkilled" processes remained in Task Manager. For
instance, there is a task to generate picture using ASP image scheduled by
SQL job but somehow certain processes like cmd.exe and IExplorer.exe are not
released and cause the SQL job non-stop running.

Even with kill job signal being sent to SQL but the SQL job will not be
cancelled until cmd.exe and IExplorer.exe are manually terminated using Task
Manager. The problem is this action require human attention and quite
irritating. Any way to do the programming (using VB.NET) to check for these
processes which are run under certain user so that can terminate them by code?

Thanks.
Nov 1 '06 #1
1 2631
Just posted this in the other newsgroup for someone the other day.

This should get you started.

'Where textbox1.text = "NOTEPAD" not NOTEPAD.EXE
Dim myProcesses() As Process
Dim myProcess As Process

myProcesses = Process.GetProcessesByName(Trim(TextBox1.Text))
For Each myProcess In myProcesses
myProcess.Kill()
Next

Cheers

Miro
"LBT" <LB*@discussions.microsoft.comwrote in message
news:65**********************************@microsof t.com...
Hi experts,

Sometimes there is some "unkilled" processes remained in Task Manager. For
instance, there is a task to generate picture using ASP image scheduled by
SQL job but somehow certain processes like cmd.exe and IExplorer.exe are
not
released and cause the SQL job non-stop running.

Even with kill job signal being sent to SQL but the SQL job will not be
cancelled until cmd.exe and IExplorer.exe are manually terminated using
Task
Manager. The problem is this action require human attention and quite
irritating. Any way to do the programming (using VB.NET) to check for
these
processes which are run under certain user so that can terminate them by
code?

Thanks.


Nov 1 '06 #2

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

Similar topics

4
by: Jaans | last post by:
I have a problem that relates to running "cleanup" code when an application is forcibly ended using the "End Process" of "Task Manager" (Please note that this is very different from "End Task"...
77
by: Charles Law | last post by:
Hi guys I have a time critical process, running on a worker thread. By "time critical", I mean that certain parts of the process must be completed in a specific time frame. The time when the...
1
by: serge | last post by:
When I start creating a new DTS Package and I choose the Analysis Processing Task icon, I only have the option of working with the local Microsoft Analysis Server. How can I choose a remote...
2
by: Praveen K | last post by:
I have a problem in communicating between the C# and the Excel Interop objects. The problem is something as described below. I use Microsoft Office-XP PIA dll’s as these dll’s were been...
3
by: gb | last post by:
I have a Windows Service that watches a directory using the FileSystemWatcher. When an Excel spreadsheet gets added to that directory, the Windows Service calls a routine that opens the Excel...
2
by: Mark Jacobs | last post by:
I'm having problems determining the memory usage of a process using the Process component. If I call Process.VirtualMemorySize.ToString I will get back a value that is nowhere near close to what...
4
by: Strah | last post by:
Is there a way to catch the event of terminating the application from the the processes tab in task manager? I have created windows app, and if a user termintates the app in the task manager,...
9
by: SeC | last post by:
Hi. Is there any way to detect if application is being killed by 'End Process' via Task Manager ?
4
by: e-Ricc | last post by:
Hi guys! Im trying to detect when a user "kills" my c# app using windows task manager, i've tried with the form events _closing and _closed managing for example putting an if inside to detect...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
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...
0
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...

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.