
set environment variable path
Quote:
> > What OS?
> Win2000
> > Do you want it to be active after your script has terminated?
> no
> > Do you want it to be permanent (survive a reboot)?
> no
This will set an environment variable for the script and all it programs it
calls. It will only apply to the current session("Process") and it's subsequent
child processes.
Set WshShell = CreateObject("WScript.Shell")
Set WshProcessEnv = WshShell.Environment("Process")
sCurrPath = WshProcessEnv("PATH")
sAddOn = "p:\test\test\"
If Right(sCurrPath, 1) = ";" Then
sNewPath = sCurrPath & sAddOn
Else
sNewPath = sCurrPath & ";" & sAddOn
End If
' Set the environment variable
WshProcessEnv("PATH") = sNewPath
--
torgeir