Microsoft® Windows® Script Host
Remove Method
WSH Reference
Version 1

See Also                      Applies To


Description
Deletes the environment variable specified by strName.
Syntax
object.Remove(strName)
Parameters
Part Description
object WshEnvironment object.
strName The name of the environment variable to delete.
Example
The following example deletes the EXAMPLE volatile environment variable and then deletes multiple variables from the User environment:
Set WshShell = WScript.CreateObject("WScript.Shell")
WshShell.Environment("VOLATILE").Remove("EXAMPLE")

Set WshUsrEnv = WScript.Environment("User")
WshUsrEnv.Remove("EXAMPLE_1")
WshUsrEnv.Remove("EXAMPLE_2")
WshUsrEnv.Remove("EXAMPLE_3")
WshUsrEnv.Remove("EXAMPLE_4")