C# windows service location
- by user743246
By using following code[C#], we can know the path where googlechrome is installed. But, this code first starts chrome.exe, then takes its path. My question is without starting chrome.exe, how can I know the path?
ProcessStartInfo startInfo = new ProcessStartInfo();
startInfo.FileName = "chrome.exe";
string argmnt = @"-g";
startInfo.Arguments = argmnt;
String path = null;
try
{
Process p = Process.Start(startInfo);
path = p.MainModule.FileName;
p.Kill();
}
catch (Exception e)
{
return String.Empty;
}