Purpose:Delete an environment variable in another process


Format:UNSETP pid [/= /R filename][(except...)] var


pidProcess ID, or the window title, or the task name
varThe variable name to delete. The name can contain wildcards


/RRead 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.


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.




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*




/=Display the UNSETP command dialog to help you set the command line options. The /= option can be anywhere on the line; additional options will set the appropriate fields in the command dialog.