I'm trying to write a script that when clicked will add a couple of entries to the PATH Environment variable in Windows, instead of making the changes manually. I see .bat files being used all the time on Windows for a variety of reasons, so can a .bat script help me with something like that?
I actually need to download a zip from a location on the Internet, extract it to a specified location, then update the PATH in environment variable. Never done this before so any hints appreciated.
The PATH variable prevents us from having to write out the entire path to a program on the CLI every time we run it. Essentially, it's just a variable that stores a bunch of shortcuts. When you enter a command on the CLI without using the absolute path, the operating system checks the PATH variable.
If you wish to change/update the PATH permanently in the environment variable, you can use the SETX command e.g.
setx path "%PATH%;C:\New Folder"
For more details information on %PATH% and other variables to access to system folder, refer to http://vlaurie.com/computers2/Articles/environment.htm
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With