Just wanted to reiterate: the earlier answer from Manohar Reddy Poreddy is the correct one. I should really be able to do this in one command. ![]() That process works every single time on both Windows 7 and Windows 8. I was able to repeat this strange behavior several times (luckily I had saved the original contents of PATH).Īt the moment, the only surefire way I know to append to the PATH is the following:Ĭopy the contents of PATH into a text file and manually add C:\Python27\ C:\Python27\Scripts\ to the end of the PATH.Ĭopy the whole thing out of the text file. Also interesting: The value of PATH changes despite the fact that setx raised an error and did not say "Success". It prints: C:\Foo\ C:\Foo\ C:\Bar\ C:\Bar\ C:\B Then it says "Error: Truncated at 1,024 characters." Now let's check what PATH contains: echo %PATH% Then I do this: setx PATH "%PATH% C:\Quux\" On one particular Windows 7 machine, I had this problem: echo %PATH% However, I have encountered some weird problems on Windows 7. I believe the quotes are necessary when %PATH% expands to include spaces. ![]() The difference is that we wrapped the second argument in quotes. If it gives the error "the default argument can only be used 2 times", then the following works some of the time: setx PATH "%PATH% C:\Python27\ C:\Python27\Scripts\" The following works at least 50% of the time on Windows 8: setx PATH %PATH% C:\Python27\ C:\Python27\Scripts\ I want to modify the Windows PATH variable using setx.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |