Hi and asking for some help or information. I need a way to avoid or disable the possibility of changing "environment variable" in a Windows OS, for a non administrator user. Thanks.
Hi and asking for some help or information. I need a way to avoid or disable the possibility of changing "environment variable" in a Windows OS, for a non administrator user. Thanks.
Check the below script that will help you to remove system variable %XVar%:
Set wshShell = CreateObject("WScript.Shell")
Set wshSEnv = wshShell.Environment("System")
sMyVar = "XVar"
wshSEnv(sMyVar) = "Vilius"
WScript.Echo "Variable " & sMyVar & " is now set to Vilius"
wshSEnv.Remove sMyVar
Bookmarks