views:

264

answers:

2

Hi

I have the following scenario:
- 64bit Windows Server 2008.
- 32bit .NET application (needs to be x86 for various reasons).
- I need to start ServerManager.msc from my .NET application.

When using Process.Start("ServerManager.msc"), I get the following exception:
System.ComponentModel.Win32Exception.
Message="The system cannot find the file specified".

On a 32bit Windows Server 2008 the code works fine...
I tried to inlcude the full path to ServerManager.msc, but that does not help either.
Also no difference if running with or without admin privileges.

Any ideas?

A: 

On WOW64, if a 32-bit application refers to C:\Windows\System32; the operating system transparently remaps this to C:\Windows\SysWOW64 (which is where the 32-bit stuff lives).

As a 32-bit application on Win64, you need to specify the full path as %SYSTEMROOT%\SysNative\ServerManager.msc.

SysNative doesn't exist on x86 Windows (there's no reverse mapping, at least on Win7 Ultimate), so you'll need to figure out whether you're on x86 or x64 first.

Roger Lipscombe
Thanks for the tipp! This helped me solve the issue. As a final step, I also needed to replace "ServerManager.msc" by "CompMgmtLauncher.exe", because the .msc file was indirectly loaded by mmc.exe. I now open the file like this: Win32Api.GetWindowsDirectory() + "\SysNative\CompMgmtLauncher.exe"
mkva
A: 

Please use depends.exe to find out which file/dll is missing.

If it is using an x86 native dll/library which is compiled in newer version of VC++ Runtime. Install the latest VC++ runtime on the 2008 server. Latest I believe is 2008 SP1.

Vivek
Not relevant to Process.Start
Roger Lipscombe