When you try to launch Bash.exe (Bash on Ubuntu on Windows) in Windows 10, the console window may open and close immediately. This happens if legacy mode is turned on for Command Prompt.
Also, if you open a Command Prompt window and type bash.exe, the following error would show up:
If you have an existing Command Prompt shortcut (cmd.exe), right-click on the shortcut and click Properties. In the Options tab, disable the checkbox for Use legacy console (requires relaunch)
If you don’t have an existing shortcut to Command Prompt, open a Command Prompt window (cmd.exe), right-click on the title bar, and click Properties. From the Options tab, you can disable legacy mode. It would be applied globally.
To apply the settings for multiple systems using a script or batch file, here is the command you need for disabling legacy mode.
REG.EXE ADD HKCU\Console /v ForceV2 /t REG_DWORD /d 1 /f
After doing so, Bash should now launch correctly.
One small request: If you liked this post, please share this?One "tiny" share from you would seriously help a lot with the growth of this blog. Some great suggestions:
- Pin it!
- Share it to your favorite blog + Facebook, Reddit
- Tweet it!
About the author
Ramesh Srinivasan founded Winhelponline.com back in 2005. He is passionate about Microsoft technologies and he has been a Microsoft Most Valuable Professional (MVP) for 10 consecutive years from 2003 to 2012.