# XP SETX Utility for PATH environment variable



## bobritter (Sep 9, 2005)

I need to use SETX to add a directory permanently to the system PATH variable. Pretty easy:
setx PATH "%PATH%;c:\mynewdir" -m

Seems to work OK BUT nowhere in the Windows "UNHELPFUL" pages do I find anything that says you MUST reboot before the change takes effect. I guess we're just supposed to know that little fact.

Is there a a nice little trick to reload system environment variables without the reboot? Sure would save some effort.


----------



## Frank4d (Sep 10, 2006)

Go to Control Panel > System > Advanced tab. Click Environment variables, highlight Path, then click Edit and add your path information. Windows will remember it until changed.


----------



## bobritter (Sep 9, 2005)

Thanks, Frank4d for the reply.

Setting the PATH variable isn't the problem, SETX does that just fine and can be done automatically during the install of my software.

The problem is that the PATH as modified either by SETX or thru the Control Panel doesn't take effect until a reboot. It would be great to have a way to avoid the reboot.

By the way, the same System Dialog available in Control Panel is available with a right click on MyComputer.


----------



## Squashman (Apr 4, 2003)

I would like to know how setx is working?
The command is set!


----------



## bobritter (Sep 9, 2005)

SETX comes with the XP Service Pack 2 Support Tools. SETX sets environment variables "Permanently" while SET only sets then for the duration of the current user session.


----------

