Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SHELL

auto update environmental variables windows

Set oShell = WScript.CreateObject("WScript.Shell")
filename = oShell.ExpandEnvironmentStrings("%TEMP%
esetvars.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
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #auto #update #environmental #variables #windows
ADD COMMENT
Topic
Name
5+7 =