Jump to content

change environment variable with script?


Over.Kill

Recommended Posts

echo %path%
C:\SYS\WINDOWS\system32;C:\SYS\WINDOWS;C:\SYS\WINDOWS\System32\Wbem
path=%path%;C:\SYS\APPS\Team OvK
echo %path%
C:\SYS\WINDOWS\system32;C:\SYS\WINDOWS;C:\SYS\WINDOWS\System32\Wbem;C:\SYS\APPS\Team OvK

<exit CMD>

echo %path%
C:\SYS\WINDOWS\system32;C:\SYS\WINDOWS;C:\SYS\WINDOWS\System32\Wbem

I have several in-house utilities I run and for ease of use, etc. I want to be able to run them from the run dialog. Is there a way to add my custom directory to the PATH variable **FROM A SCRIPT**? Because I manage systems on several networks, I want to be able to copy my apps from a flash/external drive and add the copied directory via a script, instead of doing it manually for each install.

Is this possible, or should I try and find a way to get AutoIt to do the work for me?

Edited by Over.Kill
Link to comment
Share on other sites


You could also use the MS utility named setx (search for it, it's in a resource kit).

When setting it using a reg-file you change the entire path, which may affect other programs on some of the computers.

Setx just adds to the path without changing the rest of it.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...