FANDOM


When you use the SET command from a command prompt or a bat file to set an environment variable, its only active for that session of the command prompt. To set the environment variable permanently, you have to manually go to Computer / Properties / Advanced / Environment Variables.

Another way is to create a vbs script that will do it for you. The following script will set the SSUSER environment variable to ZumaL

' This script sets the environment variable SSUSER to ZumaL
' Programmer needs to just run this once on their computer.

Set WshShell = WScript.CreateObject("WScript.Shell")

strComputer = "."
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")

Set objVariable = objWMIService.Get("Win32_Environment").SpawnInstance_

objVariable.Name = "SSUSER"
objVariable.UserName = "<System>"
objVariable.VariableValue = "ZumaL"
objVariable.Put_