Why is Windows Vista 64-bit using the default 32-bit cmd.exe? (Specific machine)

Situation:

I need to convert our current development environment from Windows XP 32-bit to Windows Vista 64-bit (*). Naturally, I ran into a lot of places in our squad system where hard paths were problematic (for example, " C:\Program Files

" becomes " C:\Program Files (x86)

" "). Fortunately, there is an environment variable %ProgramFiles%

that maps to the appropriate directory based on the original process (32-bit or 64-bit). So I updated the build scripts %ProgramFiles%

and I was sure it would be the end.

The build environment is called from the command line ( C:\Windows\System32\cmd.exe

).

Problem: On one particular machine (namely my-dev machine at work) it turns out to be C:\Windows\System32\cmd.exe

actually a 32-bit process, so the scripts find x86

the directory version Program Files

and everything works fine.

All 64-bit machines I can find (including my home machine) C:\Windows\System32\cmd.exe

are 64-bit, and 32-bit is in C:\Windows\SysWow64\cmd.exe

. So the build scripts cannot find anything they are looking for and fail.

Now I understand that 32-bit cmd.exe

must be called explicitly if you need it, and by default you get 64-bit cmd.exe

. Typical case WORKSFORME

...

Question: what happened to the car, where is it wrong? Why am I getting 32-bit cmd.exe

by default on one machine but not others? In all cases, I explicitly execute C:\Windows\System32\cmd.exe

from the menu Start|Run

, but I get different results on only one machine. They all work with the same Vista 64bit version.

Any thoughts or insights?

(*) Accept that I have to do this. I cannot say why I am doing this. Reinstalling the OS and doing everything from scratch will probably work, but that is definitely too big. Also, it was difficult enough to convince our IT department to issue Vista machines!

0


source to share


4 answers


I finally found the problem, and as expected, it's pretty simple: user error. Explorer (which itself is a 64-bit process on Windows 64-bit Vista) runs 64-bit command lines by default. If you want 32-bit CMD.EXE

you have to explicitly reference C:\Windows\SysWoW64\CMD.EXE

.

The reason it worked great on my system is because I use Far Manager for most of my use on the command line, which is 32-bit (which is why it runs 32-bit command prompts). When I checked, I must have confused 32 bit window for 64 bit window (they look the same!) And asked a stupid question.



Die in Sente, the problem with %ProgramFiles(x86)%

is that it doesn't exist in Windows Vista 32-bit, because that would be really easier.

Oh, there is nothing like a public posting to fool yourself ... :)

+2


source


If you run cmd from a 32-bit process, you will get a 32-bit cmd due to file redirection ( http://msdn.microsoft.com/en-us/library/aa384187.aspx ). Are you getting the 32-bit version of CMD when you launch it from Explorer?



+2


source


cmd.exe

runs from the start menu on both machines. Accurate reproduction:

  • Click the Start button
  • Enter " cmd

    ", only one match appears ( c:\windows\system32\cmd.exe

    )
  • Start it up.

On my work machine, it runs the 32 bit version (as demonstrated by the task manager, it has *32

it appended to the name in the tab Processes

). All other Vista 64 machines I have tried run the 64-bit version cmd

and I cannot find a rational explanation for this behavior.

I didn't check if it was explorer.exe

32bit or 64bit myself on the affected machine, it might be related ... Thanks for the hint.

+1


source


Instead, %ProgramFiles%

isn't %Programfiles(x86)%

that always going where you want it, no matter what cmd.exe is running? My 64-bit Windows XP systems have it all; excuse me for not taking the time to boot Vista.

0


source







All Articles