In c#, I am using the following code:
Process[] processes = Process.GetProcesses("firefox.exe");
Console.WriteLine(processes.Length);
Which results in:
InvalidOperationException: Couldn’t connect to remote machine.
Notes:
- OS: Windows 7, 64-bit
- I am not attempting to connect to a remote machine.
- The Remote Registry service is set to Auto and is started
Any thoughts as to why am I getting this error and how can I fix it?
According to http://msdn.microsoft.com/en-us/library/x8b2hzk8.aspx this call tries to connect to a computer names “firefox.exe” and retrieve the processes from there hence the exception.
EDIT:
Assuming you want to find all “firefox.exe” processes on the local machine you could