On one of my servers (2008 R2) powershell refuses to run executables without extension, so typing cmd (or &cmd) in command prompt results in folowing error message:
The term 'cmd' is not recognized as the name of a cmdlet
Invoking executable one of the following ways pops out separate window (which executes asynchronously in respect to parent). I've tried that in x86 version of powershell and in x64 one. I've tried -Noprofile argument. PATH seems to be OK. It includes System32 and all.
The only way I've managed to execute cmd inline form powershell is opening standard cmd.exe shell, executing powershell.exe from it and executing cmd /c echo test from it. Inception, huh?
What should I try next?
From our comment exchange, it appears that the System Environment Variable
%PATHEXT%
is not set. This is preventing the OS from determining which file extensions should be checked when searching for executables. This system variable is derived from the the following registry value:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Environment\PATHEXT
If this value is missing, you may recreate it with the following: