I'm currently working with this piece of code: - CheckedListBox1.Items.Clear()
-
CheckedListBox1.DisplayMember = "ProcessName"
-
Dim p As Process
-
For Each p In Process.GetProcesses
-
CheckedListBox1.Items.Add(p)
-
Next
But what it is doing is getting the actual .exe name of the process - example "dwm.exe".
I want it to give the file description of the .exe - example instead of "dwm.exe" the description of dwm.exe is "Desktop Window Manager" and I want that file description to show up in the checkedliskbox instead of the .exe name.
Is this possible to get a list of the running process and show the file description name instead of the .exe name?
Please help!
8 11036
Hi,
I've been searching, but it seems there is no way to find the description of the processes running. It's not a property of Process. As you can't extract the full path of the process running, you also can't use the System.IO.FileI nfo.
I think you have something in mind like the tasklist in the taskmanager. I think that list is created based on all open windows. Like I said, I don't think it can be done, but perhaps there is someone else who knows a solution.
Cheers,
Steven
Actually there is a way, I finally figured it out, here is the code if you are curious: - #
-
For Each p As Process In Process.GetProcesses
-
#
-
Try
-
#
-
Dim ProcessFile = FileVersionInfo.GetVersionInfo(p.MainModule.FileName)
-
#
-
CheckedListBox1.Items.Add(ProcessFile.FileDescription)
-
#
-
Catch ex As System.ComponentModel.Win32Exception
-
#
-
If ex.Message = "Access is denied" Then
-
#
-
Else
-
#
-
'error handling
-
#
-
End If
-
#
-
End Try
-
#
-
Next
i know this is late but how do you kill the process it found? thank you
gbello97, you should technically open a new question for your answer, but since the question has been asked we will let the mods move this around if needed: - For Each p As Process In Process.GetProcesses 'loop through your processes
-
Try
-
If p.ProcessName.ToLower = "notepad" Then 'if the process name is notepad... then kill it
-
p.Kill() 'kill the process
-
End If
-
Catch ex As Exception
-
'do something here for the exception
-
End Try
-
Next
Alternatively, you can remove the If..Then statement and kill every running process (not suggested).
You can also simply loop through all processes, searching by process name, and kill each instance of that process: - For Each p As Process In Process.GetProcessesByName("notepad") 'loop through processes for only a single process name
-
p.Kill() 'kill the process
-
Next
The code you gave me is not what I'm looking for. I want the code posted on this thread but I just wanna know how to kill the process if it's found. Thank you
I want to kill a process by its description.
Open a new thread and I'll be more than happy to help :)
Sign in to post your reply or Sign up for a free account.
Similar topics |
by: ravi |
last post by:
Hello everyone,
Could any one tell me how to find the username(owner name) from a
process handle or a process ID. ?
thank you for your help
Ravi
|
by: Ron |
last post by:
I've written a screen saver which opens multiple copies on windows 98.
I'm trying to check the process list to determine if it is already running.
So far all the example win32 routines I've found, through google, only
work on newer xp and nt versions of windows. This is the current attempt
to get the process list on windows 98:
def GetProcessNameList():
from win32com.client import GetObject
WMI = GetObject('winmgmts:')
|
by: L Mehl |
last post by:
Hello --
I am not yet an advanced SQL code writer.
Can someone help me add the extended property 'Description' to a list of
columns resulting from this code?
SELECT
SUBSTRING(table_name,1,20) AS "Table",
SUBSTRING(column_name,1,30) AS "Column",
|
by: Wilfried Mestdagh |
last post by:
Hi,
I use C# 2005 beta with NET 2005 beta.
How to kill a process ? Is this possible in this version ? I foundsom things
in help but it is not clear to me, if someone can give me brief example it
would be very appreciated.
--
rgds, Wilfried
http://www.mestdagh.biz
|
by: UJ |
last post by:
Is the name of process always the name of executable that is running? I'm
assuming a single process for a program. So in other words - if I want to
check if a program is running, can I do a
Process localByName = Process.GetProcessesByName( << Name of
executible without extension>> );
Will that work?
TIA - Jeff.
| |
by: stef mientki |
last post by:
hello,
is there a library to kill a windows process by name ?
thanks,
Stef Mientki
|
by: Liam Se Imihaf |
last post by:
Hi all,
I have a problem get the "command line" of a process in C# for some processes
(ie, tomcat5.exe). I am using Win2003.
I can use wmci as in: wmic process where name="tomcat5.exe" get processId, commandLine.
This gives the process id and the command line.
Now below C# code does not give me the command line.
|
by: louishong |
last post by:
i'm uisng a master database that has hundreds of tables and links. i
would like to create a clean mdb file and only import/link tables from
the master database where the description column is like "Project 1".
is there a way to do that?
every table has the description field populated so this is the
cleanest way i can make a subset of the master table.
any help would be appreciated.
|
by: vertigo262 |
last post by:
I don't know why this does this on the delete.
any ideas?
line 289
---------------------------------------------
The process cannot access the file 'D:\InetPub\ReefJunkies\Users\bill\Profile\PictureThumb\340x_la-rouxsmall.jpg' because it is being used by another process.
|
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...
|
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed.
This is as boiled down as I can make it.
Here is my compilation command:
g++-12 -std=c++20 -Wnarrowing bit_field.cpp
Here is the code in...
| |
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...
|
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,...
|
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
|
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own....
Now, this would greatly impact the work of software developers. The idea...
|
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();...
|
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
| |
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |