473,698 Members | 2,409 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 11031
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
3511
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
2763
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
1813
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
1969
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
1061
by: stef mientki | last post by:
hello, is there a library to kill a windows process by name ? thanks, Stef Mientki
0
2333
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
1926
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
4630
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
8678
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
8609
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
9030
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
8899
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
5861
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
4371
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
4621
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
2333
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2007
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.