|Purpose:||Delete an environment variable in another process|
|Format:||UNSETP pid [/= /R filename][(except...)] var|
|pid||Process ID, or the window title, or the task name|
|var||The variable name to delete. The name can contain wildcards|
|/R||Read variables and values from a file|
See also SETP.
You can delete all matching variables except for those specified by enclosing the exceptions in parentheses. For example, to remove all variables beginning with "v" except for var1 and var2 in the process with a PID of 1234:
unsetp 1234 (var1 var2) v*
UNSETP works by injecting a dll into the specified process and executing a command in that dll to remove the environment variable. Depending on your Windows configuration, you may need to be running an elevated session for UNSETP to work.