How to start a 64-bit process from a 32-bit process

Solution 1:

You can temporarily disable filesystem redirection around the call to Process.Start, the appropriate API's to P/Invoke are Wow64DisableWow64FsRedirection and Wow64RevertWow64FsRedirection.

Another option is to use %windir%\sysnative, which is available on Windows Vista and above.

Solution 2:

What you do is you use %windir%\sysnative to resolve 64-bit CMD.EXE and then you launch your other 64-bit program via "/c" command line option.

Solution 3:

c:\>set proc
PROCESSOR_ARCHITECTURE=x86
PROCESSOR_ARCHITEW6432=AMD64
PROCESSOR_IDENTIFIER=Intel64 Family 6 Model 70 Stepping 1, GenuineIntel
PROCESSOR_LEVEL=6
PROCESSOR_REVISION=4601

c:\>c:\windows\sysnative\cmd
Microsoft Windows [Version 6.1.7601]
Copyright (c) 2009 Microsoft Corporation.  All rights reserved.

c:\>set proc
PROCESSOR_ARCHITECTURE=AMD64
PROCESSOR_IDENTIFIER=Intel64 Family 6 Model 70 Stepping 1, GenuineIntel
PROCESSOR_LEVEL=6
PROCESSOR_REVISION=4601

c:\>

Solution 4:

Just in case this might help.. http://msdn.microsoft.com/en-us/library/aa384187(VS.85).aspx

Note that if the application is manifested to show the UAC prompt, then redirection will not take place. And also some folders are exempt from redirection.

Solution 5:

To run process/script via 64-bit cmd.exe you might use this:

%windir%\SysWOW64\cmd.exe /c %windir%\sysnative\cmd.exe /c ProgramToRun parameters

This solution works universally from both 32-bit and 64-bit processes.


p.s.
%windir%\sysnative exists only in 32-bit processes.
%windir%\SysWOW64 exists both in 32-bit and 64-bit processes.