Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Unable to run CMD in 64 bit mode on Win 7 Prof

Tags:

cmd

64-bit

32-bit

I have done my homework, honest, and tried everything I can think of but it seems that every time I open CMD I get the 32bit version, regardless of where I open it from. I have tried:

  1. Windows start orb -> CMD -> enter
  2. Typing 'C:\Windows\System32\cmd.exe'
  3. Typing 'C:\Windows\SysWOW64\cmd.exe'

In each case I am running it with Admin rights and I have UAC turned off. I can tell it's always 32 bit as I am unable in any case to run nbstat.exe (which I would expect from a 32 bit command line).

I have been into Process Explorer and both version are nodes under the same instance of csrss.exe which doesn't feel right to me.

Any thoughts?

like image 538
user1351678 Avatar asked Apr 23 '12 15:04

user1351678


2 Answers

The easiest way to see if a process launches 64- or 32-bit is to go to the process tab of the task manager, a 32 bit CMD will show as cmd.exe *32.

One way to launch a 64-bit CMD is to just use "My Computer" and double click C:\Windows\System32\cmd.exe.

One way to launch a 32-bit CMD is to do the same but double click C:\Windows\SysWOW64\cmd.exe.

Slightly odd observation; it seems that if you launch the 64-bit CMD from a 32-bit one, it will also launch as 32-bit. That may be why you're seeing the 32-bit version show up all the time. Explorer is a 64-bit process and can launch CMD in 64-bit mode.

like image 165
Joachim Isaksson Avatar answered Oct 20 '22 01:10

Joachim Isaksson


The version of command prompt that windows spawns matches the bit-ness of the launching process, via the magic of windows path redirection. Therefore, a command prompt started from a 32-bit program will be a 32-bit command prompt, and one started from a 64-bit application a 64-bit command prompt - Microsoft Technet.

The technet article suggests creating a symlink to the 64-bit version of the command prompt executable to defeat the redirect.

Reading the comments reveals that an easier method exists (not Win XP), you can use the virtual folder C:\Windows\Sysnative to get the native versions of the system tools.

Therefore, to always get a 64-bit command prompt on 64-bit windows, execute:

C:\Windows\sysnative\cmd.exe
like image 38
Mark Thomas Avatar answered Oct 20 '22 01:10

Mark Thomas