Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to create a windows cmd shell with empty environment

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?

like image 864
Peter Kirschner Avatar asked Oct 22 '25 03:10

Peter Kirschner


1 Answers

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=)
like image 97
TessellatingHeckler Avatar answered Oct 23 '25 20:10

TessellatingHeckler



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!