Menu

Inheriting PATH environment variable from Windows

ph4nt0m
2016-04-28
2016-04-28
  • ph4nt0m

    ph4nt0m - 2016-04-28

    When I installed MSYS2 from here, the PATH variable within the MSYS2 shell contained all the directories that were present in my Windows PATH variable. This seemed reasonable for me, since I would like to use MSYS2 as a replacement for cmd.exe.

    After I updated MSYS2, though, the contents of my Windows PATH were removed from the MSYS2 PATH. Has this been changed deliberately with any recent update? I could not find any information regarding the default behaviour.

     
  • Alexx83

    Alexx83 - 2016-04-28

    Open "start_shell.cmd" file in notepad and uncomment appropriate line to have FULL Windows PATH

     
  • ph4nt0m

    ph4nt0m - 2016-04-28

    Alright, thank you. Just one more question: Will this change be reverted on the next update, i.e. will "start_shell.cmd" be overwritten when a new core version is installed through pacman?

     
  • Matthieu Vachon

    Matthieu Vachon - 2016-04-28

    Yes it will.

    To void this, either launch start shell command using start_shell.cmd -use-full-path or inside Windows directly, set an environment variable for your user with name MSYS2_PATH_TYPE and value inherit.

    Just in case you do not know how, right-click on Computer icon, then Properties > Advanced system settings (left menu bar) > Advanced (tab) > Environment Variables... (button) in the dialog, in the User variables pane, press New... and enter the values specified above.

    Sorry in advance if you already knew all this :)

    Regards,
    Matt

     
  • ph4nt0m

    ph4nt0m - 2016-04-28

    Thanks a lot, Matt. :) Altough I know indeed how to set an environment variable, my batch scripting knowledge was not enough to realize that this would directly influence the local MSYS2_PATH_TYPE variable within the script.

     
MongoDB Logo MongoDB