Last active
December 26, 2015 04:28
-
-
Save dpwright/7093085 to your computer and use it in GitHub Desktop.
Overcoming Windows' bizarre ordering of %PATH% variables
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Windows constructs the %PATH% environment variable by appending the user | |
# PATH to the system PATH, which means you can't override system-level programs | |
# with your own, user-specific version. | |
# To fix this, save this script and set it to run on logon by following these | |
# instructions: http://technet.microsoft.com/en-us/library/cc770908.aspx | |
# (If step 1 is a mystery to you, go to Start->Run and type "gpedit.msc") | |
# Requires Windows 7 | |
# If your path is longer than 1024 characters, this might not work :-( | |
$sysPath = (Get-ItemProperty -Path 'HKLM:\SYSTEM\CurrentControlSet\Control\Session Manager\Environment' -Name Path).Path | |
$userPath = (Get-ItemProperty -Path 'HKCU:\Environment' -Name Path).Path | |
setx path "$userPath;$sysPath" /m |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment