How to force the command OPRCMD to run a 64-bit process on a 64-bit Server?

Document ID : KB000053526
Last Modified Date : 14/02/2018
Show Technical Document Details

Description:

When invoking a 64-bit command (for example Powershell.EXE) on a 64-bit server using the NSM command oprcmd, the server runs only the 32 bit version of it.

Solution:

In servers running Windows 64-bit, the %windir%\System32 directory is reserved for 64-bit applications. Whenever a 32-bit application attempts to access %windir%\System32, the access is redirected to a new directory: %windir%\SysWOW64 (default directory for 32 bits apps)

This file system redirection is enabled by default. It is not recommended to disable it because disabling it will affect all file operations. For more information, see: http://msdn.microsoft.com/en-us/library/aa384187(VS.85).aspx.

Even if we specify the full path to the 64-bit application, a 32-bit application (like OPRCMD) will run the 32-bit version. Unicenter Network and Systems Management r11.2 is a 32 bit application, so both of the following commands execute the 32-bit version of Windows PowerShell:

OPRCMD %SystemRoot%\sysWOW64\WindowsPowerShell\v1.0\powershell.exe
OPRCMD %SystemRoot%\system32\WindowsPowerShell\v1.0\powershell.exe

To avoid this file redirection, 32-bit applications such as OPRCMD can access and launch 64-bit applications using %WinDir%\Sysnative folder. WOW64 recognizes the Sysnative folder as a special alias. Therefore, the file system does not redirect access away from the Sysnative folder.

For more information, see: http://support.microsoft.com/kb/942589/en-us

CONCLUSION:

OPRCMD %WinDir%\Sysnative\WindowsPowerShell\v1.0\powershell.exe will launch the 64-bit PowerShell version.