SETX - delete environment variable
Posted: 2023-Jan-26, 12:03 pm
I was doing some testing which incorporated a couple of environment variables. I used SETX to create those variables in the user's context to be picked up by other applications. When done testing, I wanted to get rid of them using SETX. Now there doesn't seem to be a way do delete environment variables with SETX - the help text doesn't list a switch for that. But I found out entering double quotes does the thing. So: effectively deletes the environment variable.
Code: Select all
SETX MyEnvironmentVariable ""