473,734 Members | 2,511 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Process Description Name

2 New Member
I'm currently working with this piece of code:


Expand|Select|Wrap|Line Numbers
  1. CheckedListBox1.Items.Clear()
  2. CheckedListBox1.DisplayMember = "ProcessName"
  3. Dim p As Process
  4. For Each p In Process.GetProcesses
  5. CheckedListBox1.Items.Add(p)
  6. 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!
Jul 21 '09 #1
8 11036
MrMancunian
569 Recognized Expert Contributor
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
Jul 22 '09 #2
g3rmanpride21
2 New Member
Actually there is a way, I finally figured it out, here is the code if you are curious:


Expand|Select|Wrap|Line Numbers
  1.  #
  2. For Each p As Process In Process.GetProcesses
  3. #
  4.             Try
  5. #
  6.                 Dim ProcessFile = FileVersionInfo.GetVersionInfo(p.MainModule.FileName)
  7. #
  8.                 CheckedListBox1.Items.Add(ProcessFile.FileDescription)
  9. #
  10.             Catch ex As System.ComponentModel.Win32Exception
  11. #
  12.                 If ex.Message = "Access is denied" Then
  13. #
  14.                 Else
  15. #
  16.                     'error handling
  17. #
  18.                 End If
  19. #
  20.             End Try
  21. #
  22.         Next
Jul 23 '09 #3
gbello97
5 New Member
i know this is late but how do you kill the process it found? thank you
May 24 '14 #4
Luk3r
300 Contributor
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:

Expand|Select|Wrap|Line Numbers
  1.         For Each p As Process In Process.GetProcesses  'loop through your processes
  2.             Try
  3.                 If p.ProcessName.ToLower = "notepad" Then 'if the process name is notepad... then kill it
  4.                     p.Kill() 'kill the process
  5.                 End If
  6.             Catch ex As Exception
  7.                 'do something here for the exception
  8.             End Try
  9.         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:
Expand|Select|Wrap|Line Numbers
  1.         For Each p As Process In Process.GetProcessesByName("notepad") 'loop through processes for only a single process name
  2.             p.Kill() 'kill the process
  3.         Next
May 25 '14 #5
gbello97
5 New Member
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
May 25 '14 #6
gbello97
5 New Member
I want to kill a process by its description.
May 25 '14 #7
Luk3r
300 Contributor
Open a new thread and I'll be more than happy to help :)
May 25 '14 #8
gbello97
5 New Member
Ok how do I do that haha
May 25 '14 #9

Sign in to post your reply or Sign up for a free account.

Similar topics

1
3515
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
3
2767
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:')
0
1815
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",
3
1971
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
4
4777
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.
0
1062
by: stef mientki | last post by:
hello, is there a library to kill a windows process by name ? thanks, Stef Mientki
0
2340
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.
4
1929
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.
6
4631
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.
0
8946
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
9449
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, 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...
0
9310
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
9236
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,...
0
9182
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 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...
0
8186
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, 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...
0
6031
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();...
1
3261
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
2
2724
muto222
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.