Windows 10: Choosing default for bash in cmd Solved

  1.    15 Mar 2017 #1

    Choosing default for bash in cmd

    Hi all,

    I have installed git before, so as a side effect, mingw is also installed. Currently, if I type bash in cmd, I got in bash provided by mingw.
    Now I want to activate Linux subsystem on windows 10. The question is, can I set the default or configure what the bash command in cmd should do (either active Linux subsystem or get into mingw).

    Bests, bbbhh
      My ComputerSystem Spec

  2. Posts : 93
    Windows 10
       16 Mar 2017 #2


    On the Windows command line, if you know you have two commands with the same name available for use on your system, the one listed first in the Path environment variable will be used. However, if it exists, the one residing in the current directory will take precedence.

    Enabling the Windows Subsystem for Linux places a bash.exe binary in C:\Windows\System32. This will be the bash instance used if an executable named “bash” doesn’t exist in any of the paths listed before C:\Windows\System32 in the Path. But if your command prompt is open at C:\Windows\System32, C:\Windows\System32\bash.exe will be used regardless of bash-es in the Path.

    You can view the Path variable on the command prompt by echo-ing it.
    C:\Users\Pyprohly>echo %path%
    C:\Program Files (x86)\Parallels\Parallels Tools\Applications;C:\Program Files (x86)\Intel\iCLS Client\;C:\Program Files\Intel\iCLS Client\;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\Program Files\dotnet\;C:\Users\Pyprohly\AppData\Local\Microsoft\WindowsApps
    C:\Users\Pyprohly>echo %path:;=&echo(%
    C:\Program Files (x86)\Parallels\Parallels Tools\Applications
    C:\Program Files (x86)\Intel\iCLS Client\
    C:\Program Files\Intel\iCLS Client\
    C:\Program Files\dotnet\
    Sometimes you may need to reorder the Path if a particular instance of a command being used isn’t the one you need quick access to. Editing the Path variable can be done through Control Panel > System and Security > System > Advanced system settings > Environment Variables….

    A quick and easy way to determine which instance of a command will be used for the current command prompt session is to use the where command. E.g.,
    C:\Users\Pyprohly>where bash
    The first one listed is the one that will be used if the command was to be typed.
      My ComputerSystem Spec


Related Threads
I have an Acer laptop, bought in November, 2014 and about 6 months ago, I tried using the CD drive for the first time.It opened but it didn't read the disc.Now, I tried opening it and the button won't work and choosing Eject says: 'An error occured...
What I mean is, if I select to keep my personal files only, will the installed programs be removed completely from my hard drive, or will they be moved to the Windows.Old folder like what happens in Windows 7 or Windows 8/8.1 ? Because I would...
Choosing Which Updates To Keep in Windows Updates and Activation
With Windows 10 I cannot find anyway to decide which updates I want installed and which I dont. I dont mean the new builds, I am on the fast ring and want them but updates like Windows Defender, I dont want those as I have BitDefender. Some Office...
Hardware & Drivers GPU - The Core Basics for Choosing One in Tutorials
Choosing a GPU - The Core Basics There are many factors to take into consideration these days when choosing a GPU. With the myriad of hardware combinations and multiple versions of numerous cards available it’s become somewhat of a minefield ...
Our Sites
Site Links
About Us
Windows 10 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 10" and related materials are trademarks of Microsoft Corp.

© Designer Media Ltd
All times are GMT -5. The time now is 07:16.
Find Us