Find a running executable - 138819

Is there a way to find out if an executable (with known full path of the exe 
file) is running or not in C#?

0
Utf
11/17/2009 5:29:04 AM
dotnet.languages.csharp 1931 articles. 0 followers. Follow

1 Replies
803 Views

Similar Articles

[PageSpeed] 11

Hi Roy,

If you know the process name you can use the System.Diagnostics.Process 
class to find it.

If you don't know the process name, you can still use the Process class, but 
you need to use Process.GetProcesses and loop through each 
Process.MainModule.FileName to find the one matching the executable.

-- 
Happy Coding!
Morten Wennevik [C# MVP]


"Roy" wrote:

> Is there a way to find out if an executable (with known full path of the exe 
> file) is running or not in C#?
> 
0
Utf
11/17/2009 11:13:02 AM
Reply:

Similar Artilces:

Access 2002 is freezing up, 97 runs perfect
Hi all, I am at my wits end... I have an application that had been running fine (even in XP) however the last week or so it is Freezing. In the taskbar it shows as "Responding" but no way.... This is the setup: The application does a bunch of ODBCs to an Oracle database, 250 or so records in Access averaging about 3 ODBCs each. I am connecting using: Set con = wrkODBC.OpenConnection("ODBCConnection", , , _ "ODBC;DSN=" & DSN & _ ";UID=" & User & _ ";PWD=" & PW & _ ";...

Running Excel Pivot Table with Local cube on http:// Sub-Web???
Hello I have a SQL 2000 local cube that I created on my computer that is accessed by an Excel (XP) pivot table workbook. I would like to place & run both on a secure sub-web on my company http:// website. Both files were FTP'ed to the sub-web successfully. When opening the Excel file I am prompted for the local cube: the prompt is referencing the cube location on my computer where it was originally created with SQL 2000. I am unable to point it to the sub-web location. It appears that the Excel workbook has hard coded the original cube location back to my computer. Is there a way ...

Keeping a macro running after the calling workbook is closed (XL2K)
I run a macro in Wkbk1, the macro uses the Application.Run command to call a macro in Wkbk2. The second macro closes Wkbk1. As soon as Wkbk1 is closed the macro stops running. Is there a way to stop this from happening? Thanks in advance Why not just close the workbook after the other macro finishes? application.run "book2.xls!othersub" thisworkbook.close savechanges:=false 'true? I didn't see a way to stop it from happening. Simon C wrote: > > I run a macro in Wkbk1, the macro uses the Application.Run command to > call a macro in Wkbk2. > > The seco...

Finding duplicate records in multiple worksheets
Each month I run a employee FT/PT status vs avg hrs worked exception report which is exported to Excel. I manually flag repeat occurances (employee on the report 3 mos, etc.). I would like to run a query which would compare up to 12 monthly worksheets and count the number of times an employee was on the monthly reports. This count would be part of the new monthly report each month. If your data were laid out nicely, it sounds like you could use a pivottable. If you have the employees name in column A, the date in column B, You could select your range in columns A:B and then data|p...

Advanced Find tab selections conflict
Has anyone noticed that in Outlook 2003 the advanced find selections can conflict between tabs (ie, different search phrases specified on the Messages tab and on the Advanced tab). Sometimes the selections are additive, sometimes one overrides another, but there doesn't seem to be any rhyme or reason to it. Is there something that Microsoft has published that explains this Advanced Find behavior? Note: this is one of those "just curious" posts, so unless you too are really bugged by this or know the answer, just laugh and move on... Ray Which fields are you...

Glitch in Outlook 2000 running under Windows XP ???
I recently got a new computer which runs Windows XP Pro. I installed my old Office 2000 on the new computer, and I noticed that Outlook no longer automatically formats telephone numbers when you enter them in the Contacts. It used to be the case (when I was running it under Win 98 SE) that you could enter the 10 digits of a phone number in any haphazard manner you wished, and the software would format it perfectly, placing parentheses around the area code and inserting a hyphen after the first three digits of the number. But I can't get it to do that in this new installation (under Wind...

Run a query based on user input to a text box
I am creating a database to manage Auction Bids for a live radio station phone auction weekend. I have a form where the user is entering names as the bidders call in. I want to be able to have entry into a text box cause a query to run and populate a list box so that if a caller has been entered before, the user can click on an existing name. So for example, if the first keystroke is A , then the list box will be populated with all names beginning with A. If the next keystroke is l to give Al then the list box will be repopulated with only names beginning with Al (e.g. Alice, Aliso...

Can't find AutoRecover file in path specified in Options dialog.
I had a file open in Excel 2002 in which I made some changes, and then mistakenly closed without saving. But after making those changes, and before closing, it had remained open for over an hour. I'd like to recover those changes, and the path specified in the "AutoRecover save location:" text box in the Options - Save dialog tab is: C:\Documents and Settings\MyUserName\Application Data\Microsoft\Excel\ However, I couldn't find a *.xls file in that directory. (The only thing in that folder is a file named Excel10.xlb and another folder named XLSTART). I don'...

Exce; - Urgent
Hi, Please can someone help me (and a few others by the looks of it) wit an error I keep receiving. I have followed all the instructions in th Course booking Example for creating a user form, but when it comes t assigning the macro, it doesnt work. I then get the Run-time Error 424, Object undefined? Please could someone tell me what I am doing wrong. Thanks Andre Attachment filename: testa.xls Download attachment: http://www.excelforum.com/attachment.php?postid=54132 -- Message posted from http://www.ExcelForum.com ajw150 Check your form name Sub ...

How do I find out my server?
I don't know how to find out what the server and the other thing for incoming and outcoming messages. I Don't know my e-mail provider is because you can make your own email. I need some help thanks :) "Jmfire94" <Jmfire94@discussions.microsoft.com> wrote in message news:24959DA3-EB1F-49CD-A78F-E45C7D401090@microsoft.com... >I don't know how to find out what the server and the other thing for >incoming > and outcoming messages. I Don't know my e-mail provider is because you can > make your own email. I need some help thanks :) What...

Finding Accounts with no related Contacts CRM 3.0
Hi, I am trying to find all accounts where there are no related contacts but cannot work out the advanced find syntax to do this. I presume I am just missing something obvious. any ideas. Thanks Justin Hi Justin, You are not missing anything. CRM does not support a NOT operator in queries. You can easily search for accounts that do have at least one contact, but the opposite does not work. The only workaround is a report or some kind of server task (service, plug-in, workflow) setting a count attribute in an account whenever a contact is assigned or removed from an account, so that y...

Money 2007 running balance BUG
Hi all, I was hoping someone else could help verify this. I'm using Money 2007, and I automatically download balances/transactions from my bank (Bank of America). I noticed today that my running balance (in Money) was way off from where I thought it should be; on investigation, I found that money is re-subtracting reconciled transactions in my register despite the fact they have already been subtracted from my account balance. Here's a fictional example of what I mean: I start the day with a $100 account balance, and make five transactions: Breakfast - $5 Lunch - $10 ATM Withd...

Macro runs fine from VBEditor, but not button
Hi, this macro was running fine, until the conversion to Office 2007. In the Locations worksheet I have a list of locations in Zone 1. A worksheet is created for each store in Zone 1. I manually move the created worksheets into another Book. Then I go back to the original file to run Zone 2. Only now I'm getting an error: Cannot run the macro 'Book 2.xlsx'!PrepareReport'. The macro may not be available in this workbook. Why is it looking to the new book for the macro? The macro is in the original file. It does let me click on the Developer tab, Macros...

what does the outline tool icon look like and how do I find it?
I have spent hours trying to do a table of contents following the 2003 Word directions. No luck. Can anyone give me step-by-step directions. Every time I hit the ok in the table of contents box, it comes back "can't find ...." Now what? I can't find the outline icon on my toolbar. What does it look like? I am a novice, so please bear with me. See http://www.ShaunaKelly.com/word/toc/CreateATOC.html for instructions you can follow. -- Suzanne S. Barnhill Microsoft MVP (Word) Words into Type Fairhope, Alabama USA http://word.mvps.org "Professo...

Find field in CRM and Case search in CRM
hey: I have a ton of cases with emails attached/regarding each case individually. How can we search these cases for all cases that have a common element, for example: I want to search all my cases for the word "disconnect" to see if it appears ANYWHERE in the case, email, title, or part of this case. Anyone know how I can do this? FYI: Building a specialized advanced find won't work because I need the ability to search ANY word -- today I want Disconnect tomorrow, latency, etc... Actually, an Advanced Find might be a good way to go, because you can save your Advanced F...

Assign task cannot find object
I am using Outlook 2003 (11.5608.5703) to assign a task to another user. Sending the task results in the following error message: The object cannot be found. The task appears in my task list assigned to the specified user with a status of 'waiting for response from recipient'. However, the notification email is never sent to the assigned user. We are using Exchange Server 2003 on Small Business Server. Thanks in advance for any help or advice ou can offer. ...

find value from a query
I have a dynamic qryParametersLast in which I have a field cboClassification that I must now search through to determine a value to place in the report header. In descending order the values for cboClassification are secret, confidential, FOUO and unclass. If secret is there then the header is secret, if no secret but confidential then the header is confidential, etc... I have absolutley no idea as to how to go about doing this. Can someone point me down the right path? Thanks Dave I thought I read a similar question recently where it was suggested you have a table that describes the ord...

Executing multiple queries through a macro
Currently we have a macro that kicks off different queries to access data from the same datasource. Before each query runs, it will ask for the userid and password. Unfortunately, we can't save the password because of security reason. So we need type in the same userid & password many times. When the first query runs, the connection to the datasource is established. I was wondering if there is a way we can do to reuse that connection and eliminate the need of repeatedly typing in the userid & password for connecting. Any help is appreciated. Thanks! Sharon ...

How can I find and delete tabs and carriage returns ?
When I save an Excel worksheet as a tab-delimited text file, I get additional carriage returns in rows below the data I'm interested in exporting. When I view the text file in Word, I see all the additional tabs and carriage returns. I've tried going back and clearing (tried Edit/Clear/All and Edit/Delete) those rows from the spreadsheet and then creating a new text file but the tabs and carriage returns are still there. Can anybody help me eliminate these control characters? I guess I could just copy the cells of interest to a new spreadsheet but I'd like to know how...

find an Outlook Web Access Tutorial?
Where can I find an Outlook Web Access tutorial? -- Fishman4 Ask in an Exchange group - OWA is a part of Exchange, not Outlook. --� Milly Staples [MVP - Outlook] Post all replies to the group to keep the discussion intact. All unsolicited mail sent to my personal account will be deleted without reading. After furious head scratching, Fishman4 asked: | Where can I find an Outlook Web Access tutorial? ...

Custom toolbar button to run VBA add-in
How do I create a custom toolbar button to execute VBA script in and add-in? I know how to create a custom toolbar button to run a macro, but how do you assign it to run VBA code? hi, excel already has tool bars for that. VB... Right click the main excel tool bar then click customize. then click the tool bar tab. read down and cleck vb. macro... Right click the main excel tool bar then click customize. click the command tab. in the right pane select macro. click and drag the smiley face to the tool bar(any where you want it. you can move it later if you want) click the modify button. cl...

Finding Archieved Emails
I have clicked to accept achived/copmpact emails and can no longer find some of my old emails. Please can you tell me where they are stored on my PC and how to access them again. I am on Vista with Windows mail. Many thanks, -- Paul Windows Mail keeps the raw message files in the following directory: C:\Users\username\AppData\Local\Microsoft\Windows Mail\Local Folders\... =20 --=20 Gary VanderMolen, Microsoft MVP (Mail) http://mvp.support.microsoft.com/default.aspx/profile/vandermolen "Paul" <Paul@discussions.microsoft.com> wrote in message = news:8...

Find Pictures and Hyperlink
I do a lot of stuff with pictures and hyperlinking them in excel. I have a column labled picture ID number, which, for example, would have "1898" in a cell and the filename of the picture would be "IMG_1898." I was wondering if there is a way of writing a function or something in which the program searches for the picture I want based on the number in that column, without me having to find the picture myself and hyperlink it. It would make things a lot faster for me if I could find a quicker way to do this. Like this: http://www.mcgimpsey.com/excel/lookuppics.ht...

How can I have excel search and add multiple cells to find a targe
I am trying to figure out a way to get excel to search and add multiple cells in different combinations until it finds my target number. Example. I have 30 cells with varying amounts in them. I know that a combination of two or more of those cells will equal the number I am searching for. I want to find a way to have excel sort through the 30 cells, adding them in different combinations untill it finds the combination(s) of cells that totals to the number I specify... (like B3,B8,B10=100. Or 20+30+45+5=100) Does ANYONE have a solution to this... ANY information would be greatly apprec...

Where can I find a user's home directory in sbs 2003
Hi there, I want to remove some user from the Active Directory. Before I do that I would like to check on the home directory first. Where can I find the 'Home directory' please. Many thanks, Exchange doesn't have any such "home directory". -- Ed Crowley MVP - Exchange "Protecting the world from PSTs and brick backups!" "Smiley" <firework123@googlemail.com> wrote in message news:epvr3h$hl4$1$8300dec7@news.demon.co.uk... > Hi there, > > I want to remove some user from the Active Directory. Before I do that I > would like to ...