If I start a new CMD shell from an existing shell, the new shell inherits the existing environment. Is there a way to start a new shell but have it initialized to the system defaults and not inherit?
Current result:
B:\>set _test=blooharky
B:\>cmd
Microsoft Windows [Version 6.1.7600]
Copyright (c) 2009 Microsoft Corporation. All rights reserved.
B:\>set _
_test=blooharky
Desired result:
B:\>set _test=blooharky
B:\>cmd /env=default
Microsoft Windows [Version 6.1.7600]
Copyright (c) 2009 Microsoft Corporation. All rights reserved.
B:\>set _
Environment variable _ not defined
[update] Solution for this is start /i cmd
, as shared by dbenham, below. However it doesn't help in the situation where the current shell is already second generation. Example:
d:\>set _
Environment variable _ not defined
d:\>set _test=blooharky
d:\>cmd /k
:: some work done using _test here...
:: ...but after we need a new clean shell:
d:\>start /i cmd
d:\>set _
_test=blooharky
:: uhoh, our shell isn't clean!