L
L
lik1732021-06-11 17:39:19
cmd/bat
lik173, 2021-06-11 17:39:19

How to remove all variables in cmd (only in one window)?

How to remove them?
By type
set PATH=

Tried
set *=

Need to remove all variables (absolutely) for one cmd session

Probably possible with for, but I don't know how

Answer the question

In order to leave comments, you need to log in

1 answer(s)
W
wisgest, 2021-06-11
@wisgest

You can probably use for

That's right, you can use the forkey to /fprocess the output of a command setwithout parameters, getting the names of all ( almost ) defined environment variables (parts of the output lines up to the : sign =) delims==: (when used in batch files , you must double before the loop variable).
for /f "delims==" %v in ('set') do set "%v="
%

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question