9

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?

user1351678
  • 91
  • 1
  • 1
  • 2

2 Answers2

8

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.

Joachim Isaksson
  • 176,943
  • 25
  • 281
  • 294
  • 1
    If you double-click on `C:\Windows\System32\cmd.exe` you get a 32 bit shell, not 64. Double-click on `C:\Windows\SysWOW64\cmd.exe` is 32 bit shell, not 64. Just execute python and watch the message. It always says [..] on win32, meaning that the process shell on which python is running is win32 – Echeban Dec 07 '19 at 20:17
  • @Echeban that is completely wrong. Python says the version is win32 no matter what version of python or of Windows, it just means any version of windows, 32- or 64-bit. – Amber Cahill Jul 21 '22 at 14:15
3

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