' ---------------------------------------------------------------
' From the book "Windows Server Cookbook" by Robbie Allen
' ISBN: 0-596-00633-0
' ---------------------------------------------------------------

' ------ SCRIPT CONFIGURATION ------
strVarName = "VI400_LOGON_MIXED"
strVarValue = "YES"
strComputer = "."
' ------ END CONFIGURATION ---------
set objVarClass = GetObject("winmgmts:\\" & strComputer & _
                            "\root\cimv2:Win32_Environment")
set objVar = objVarClass.SpawnInstance_
objVar.Name = strVarName
objVar.VariableValue = strVarValue
objVar.UserName = "<SYSTEM>"
objVar.Put_
WScript.Echo "Created environment variable " & strVarName
WScript.Echo "Please Restart your Computer"

