To see your environment variables, type set in the command line. This will show you a bunch of stuff like:
ALLDATA=C:\Users\windowsjoe\AppData\Roaming
The setx command is an extension of set which allows you to create or modify environment variables, persisting the result across sessions. It was first integrated into Windows Vista and is a staple for Windows 10 and Windows 11.
To use setx to append to your PATH variable you will want to do something like this:
setx PATH "%PATH%;C:\Your\New\Directory"
For Windows Joe, a special scripts directory holds a lot of useful scripts. Hence, the path is updated to:
setx PATH "%PATH%;C:\users\windowsjoe\scripts"
If successful, you will see the message "SUCCESS: Specified value was saved.".
However, you will not be able to see the results using echo %PATH% until you start a new session.
No comments:
Post a Comment