I have a script that can be run to add the variable, but it will only
add the user variable if I put the account name. The script looks like
this;
strComputer = "."
Set objWMIService = GetObject("winmgmts:\\" & strComputer &
"\root\cimv2")
Set objVariable = objWMIService.Get("Win32_Environment").SpawnInstance_
objVariable.Name = "TEST"
objVariable.UserName = "DOMAIN\USERNAME"
objVariable.VariableValue = "This is a test"
objVariable.Put_
If I actually put the domain and user name in, it works and adds the
variable, but I need to be able to convert it into an MSI file and
deploy it to various machines. I have tried Domain/%username% but that
does not work. Is there another string that I can put there that adds
it to the user who is logged in?