Remove Method |
Description
Removes an existing environment variable.
PowerBASIC Syntax
Arguments
Remarks
The Remove method removes environment variables from the following types of environments: PROCESS, USER, SYSTEM, and VOLATILE. Environment variables removed with the Remove method are not removed permanently; they are only removed for the current session.
Example [PowerBASIC]
#INCLUDE "WSHOM.INC"
LOCAL pWsh AS IWshShell LOCAL pWshEnv AS IWshEnvironment LOCAL vType AS VARIANT
pWsh = NEWCOM "WScript.Shell" ' Get a reference to environment collection vType = "PROCESS" pWshEnv = pWsh.Environment(vType) pWshEnv.Item(UCODE$("TestVar")) = UCODE$("Windows Script Host") pWsh.Remove UCODE$("TestVar")
|