How to create a windows cmd shell with empty environment

288 views Asked by At

I want to create a windows cmd with a empty environment, meaning no env variables. What would be the easiest way to get rid of them?

1

There are 1 answers

0
TessellatingHeckler On BEST ANSWER

Run set to list them all, split by the = sign, set them all to empty.

for /f "usebackq delims==" %f in (`set`) do (set %f=)