views:

614

answers:

1

Hi, Is there anyways to get the executable file path of a running Windows service without requiring administrator execution level privilege in .Net? (Without causing the UAC to get the user's confirmation)

A: 

Try getting from Registry:

using Microsoft.Win32;
.
.
.

RegistryKey hklm = Registry.LocalMachine;
hklm = hklm.OpenSubKey(@"System\CurrentControlSet\Services\SERVICE_NAME");

string servicePath = hklm.GetValue("ImagePath");
Zanoni
Reading form registry requires administrator execution level privileged. Doesn't it?
Mohammadreza