appending to the path variable

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Post Reply
Message
Author
grahaml
Posts: 11
Joined: 15 Mar 2012 10:42

appending to the path variable

#1 Post by grahaml » 15 Mar 2012 10:47

Hello
I have never done any dos programming before, but need a script that will append (permanently) a value to the path variable; in addition the script should only add the value if it is not already in the path variable.
Any help, pointers etc would be apprecitaed

aGerman
Expert
Posts: 4743
Joined: 22 Jan 2010 18:01
Location: Germany

Re: appending to the path variable

#2 Post by aGerman » 15 Mar 2012 18:23

I remember there was already a thread and I found it.
http://www.dostips.com/forum/viewtopic.php?f=3&p=11163#p11163

To change it permanently you have to change it in the registry (HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Environment) using REG ADD and restart (perhaps restarting process "explorer.exe" is sufficient). An alternative could be the SETX command (if available).

Regards
aGerman

grahaml
Posts: 11
Joined: 15 Mar 2012 10:42

Re: appending to the path variable

#3 Post by grahaml » 16 Mar 2012 01:55

Thanks
I'll give it a try

Post Reply