I've been trying to determine if process A
, that I installed, is already running on the machine. Process A
requires admin priviliges, it is installed in C:\ProgramData
and it is usually started as a service. There are many processes on the machine, that are named A
. To find out, if this is my process, I inspected the path to exe file.
You can do this with process.MainModule.FileName
or more elaborate setup that is documented in this question
Unfortunately, you cannot inspect the path of executable started as administrator without having administrator priviliges your self.
Is there another way to determine if the process with the name A
is indeed the one you are looking for? What else can be checked beside path to executable? What workaround do you recommend?
UPDATE:
I misinterpreted the observations. If the process is started as a service, it is run as a SYSTEM
user. Because of that, you cannot determine the executable path without having the admin priviliges your self.