Windows has the setx
command:
Description:
Creates or modifies environment variables in the user or system
environment.
So you can set a variable like this:
setx FOOBAR 1
And you can clear the value like this:
setx FOOBAR ""
However, the variable does not get removed. It stays in the registry:
So how would you actually remove the variable?