Answers for "auto update environmental variables windows"

0

auto update environmental variables windows

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
Posted by: Guest on August-20-2021
0

auto update environmental variables windows

@echo off
%~dp0resetvars.vbs
call "%TEMP%\resetvars.bat"
Posted by: Guest on August-20-2021

Code answers related to "auto update environmental variables windows"

Browse Popular Code Answers by Language