How to uniquely identify a process?

  • Thread starter Thread starter nano2k
  • Start date Start date
N

nano2k

Hi
I have an application (let's call it Main.exe) and a helper process
(call it Update.exe) that periodically updates Main app.
Update.exe needs to reside in memory, but I need to make sure that
EXACTLY ONE process is running.
Anyway, other "Update.exe" processes may run simultaneously at one
time, so I need to check the right one.
What's the most reliable method?

Thanks.
 
Hello nano2k,

Use Global Mutex in your update.exe http://msdn2.microsoft.com/en-us/library/system.threading.mutex.aspx

---
WBR, Michael Nemtsev [.NET/C# MVP].
My blog: http://spaces.live.com/laflour
Team blog: http://devkids.blogspot.com/

"The greatest danger for most of us is not that our aim is too high and we
miss it, but that it is too low and we reach it" (c) Michelangelo

n> Hi
n> I have an application (let's call it Main.exe) and a helper process
n> (call it Update.exe) that periodically updates Main app.
n> Update.exe needs to reside in memory, but I need to make sure that
n> EXACTLY ONE process is running.
n> Anyway, other "Update.exe" processes may run simultaneously at one
n> time, so I need to check the right one.
n> What's the most reliable method?
n> Thanks.
n>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top