Method:  WshEnvironment.Remove

object.Remove strName

The Remove method deletes the environment variable with the specified name. If no such environment variable exists, a runtime error will be generated.

The following JScript code removes the System environment variable named "MyVar1".

Code:
Set objShell = WScript.CreateObject("WScript.Shell")
Set objSysEnv = objShell.Environment("SYSTEM")
objSysEnv.Remove("MyVar1")



Copyright 1999-2001 by Infinite Software Solutions, Inc. All rights reserved.
Trademark Information