WinBatch Tech Support Home

Database Search

If you can't find the information using the categories below, post a question over in our WinBatch Tech Support Forum.

TechHome

Environment

Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.

Add to PATH Environment Variable

 Keywords:  PATH Environment Variable

Question:

Does anyone know how to add the PATH to a new program to WinNT/2K and Win9x machines? I already have a script that IDs the OS and branches off based on NT or 9x.

Answer:

Do you mean append something to the PATH variable? This will work for NT & W2k not sure about Windows 9x.
OrigPath=RegQueryExpSz(@RegMachine, "SYSTEM\CurrentControlSet\Control\Session Manager\Environment[Path]")
NewPath = StrCat(OrigPath, ";c:\blahblah\yadayada")
RegSetexpsz(@RegMachine, "SYSTEM\CurrentControlSet\Control\Session Manager\Environment[Path]",NewPath)

Article ID:   W15489
File Created: 2003:05:13:11:28:10
Last Updated: 2003:05:13:11:28:10