Bash not executing from command line

Description:

I am not able to execute bash from my command line opened from desktop. I have to cd to system32 to run it.

Error message:

‘bash’ is not recognized as an internal or external command,
operable program or batch file.

Expected results:

After I enter bash in the cmd, the Windows Subsystem for Linux opens in the current directory.

Extra:

I have enabled Windows Subsystem for Linux, and bash works fine on the Ubuntu app. I think there is a PATH issue, but not sure how to fix it.

Windows Developer Mode is enabled. Legacy Console is unchecked.

System environment variables with their values:

ComSpec                  C:Windowssystem32cmd.exe
DriverData               C:WindowsSystem32DriversDriverData
NUMBER OF_PROCESSORS     8
OS                       Windows_NT
Path                     C:Program Files (x86)Microsoft SDKsAzureCLI2wbin;C:Pr...
PATHEXT                  .COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC
PROCESSOR_ARCHITECTURE   AMD64
PROCESSOR_IDENTIFIER     Intel64 Family 6 Model 142 Stepping 12, GenuineIntel
PROCESSOR_LEVEL          6
PROCESSOR_REVISION       8e0c
PSModulePath             %ProgramFiles%WindowsPowerShellModules;C:Windowss...
TEMP                     C:WindowsTEMP
TMP                      C:WindowsTEMP
USERNAME                 SYSTEM
windir                   C:Windows

Search results in System32

bash.exe.mui                                    Date modified: 2020-07-03 7:33 PM
C:WindowsSystem32en-US   Type: MUI File      Size: 4.50 KB

bash.exe                                        Date modified: 2020-01-01 10:10 PM
C:WindowsSystem32         Type: Application   Size: 118 KB

Answer

Cause of error

There is a bug with windows thinking legacy console is activated when it is actually unchecked.

Solution

Steps:

  1. Open Command Prompt
  2. Right Click the top bar, and press Properties
  3. Go to options tab, and check Legacy console
  4. Relaunch command Prompt
  5. Go back to the options tab, and uncheck the Legacy console
  6. Relaunch
  7. Windows BUG: The command prompt is most likely a black box with no text
  8. Go to Properties, and then the Terminal tab
  9. Uncheck Use separate foreground and ‘Use separate backround’
  10. Now type bash in cmd and it should work flawlessly.