yes, you can ... however, you will have to restart your session. see the following link:
Is there a command to update environment variables from the command line on Windows?
'RESETVARS.vbs
Set oShell = WScript.CreateObject("WScript.Shell") filename = oShell.ExpandEnvironmentStrings("%TEMP%\resetvars.bat") Set objFileSystem = CreateObject("Scripting.fileSystemObject") Set oFile = objFileSystem.CreateTextFile(filename, TRUE) set oEnv=oShell.Environment("System") for each sitem in oEnv oFile.WriteLine("SET " & sitem) next path = oEnv("PATH") set oEnv=oShell.Environment("User") for each sitem in oEnv oFile.WriteLine("SET " & sitem) next path = path & ";" & oEnv("PATH") oFile.WriteLine("SET PATH=" & path) oFile.Close
Here is how I did it:
SET oShell = CREATEOBJECT("Wscript.Shell") dim varSet SET varSet = NOTHING SET varSet = oShell.Environment("SYSTEM") varSet("WinVer") = "6.0.2008"
Then in a separate VB script (resetvars.vbs) I called from a CMD script:
cscript //nologo \\%APPSERVER%\apps\IE9.0\restartvars.vbs call %TEMP%\resetvars.bat
tgkone
source share