First off, there are two types of environment variable - System and User. When both are set, User overrides System.
System vars are defined in the HKLM hive, while User vars are in the HKCU. Once environment vars are defined, you can't tell whether they are System or User unless you consult the registry, or have personal knowledge of how they were defined.
If you use Set "X=", you will unset the User var - any system var might still be defined! Again, setting these do not affect the current Kix environment, so Kix can't tell if it's changed unless you Shell another Kix script.
Bottom line, if you set it with the Kix Set command, you need to use Set to remove it, and SetM to remove entries defined with SetM. If you don't know how it was defined, and want it completely removed, you'll need to define both System and User vars with empty values using Set and SetM.
Glenn
_________________________
Actually I
am a Rocket Scientist!