Button to add dir to %PATH% variable?

Is it possible to create a button which adds the directory actually displayed in the Lister to the PATH environment variable? (The addition would be only temporary until Windows closes). This would be very handy.

Using the set command through a DOS script would not work because the change would only be local to that DOS prompt. You would need an external program that is capable of modifying environment variables system-wide. I don't know if such a program exists (maybe it's part of Windows already?) but if you can find one, adding it to an Opus button would be trivial.

Am I misunderstanding you here Jon?
Yes, the change would only be local to that prompt until that DOS window closes.
Perhaps that's what Peter really wanted ???

On Vista with UAC on :

cd {sourcepath}
@admin
color 47
path %path%;{sourcepath}
path
pause

If UAC is off the @admin needs to be removed.

Well he did say "until Windows closes" which to me implies that he wants the variable to be available system-wide...

Thanks Jon,
I only wanted to know if I was understanding you.

You're the only one who can determine that :slight_smile:

You can do it permanently using the setx command, apparently.