Windows has a setx command
Description: Creates or modifies environment variables in the user or system environment.
So you can set such a variable
setx FOOBAR 1
and you can clear a value like this
setx FOOBAR ""
However, the variable is not deleted; it remains in the registry

So, how would you actually delete the variable?
windows environment-variables registry
anon Nov 04 2018-12-12T00: 00Z
source share