Show variables in columns ...

  • This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.
... and unset the selected one.

Not the best description of what it is, so here is a picture:


As I usually start building my scripts on the command-line, after a while you get a lot of environment variables flying around. This alias lists all of them and let me easily clean the ones I don't need anymore.
Just select the %var% you no longer need, press Enter and it's gone.
(But you could also use this alias for just listing the %vars% : Select "Quit...." to, well ... quit :-)

alias SUNSET=`( echo Quit.... & do var in /p set %1 ( echo %@left[35,%@word["=",0,%var]%@repeat[ ,35]] = "%@word["=",1,%var]") ) |! unset %@word[0,%@select[con,1,1,40,100,Unset ...]] 2>nul`
(If you didn't guess already: SUNSET is a combination of Show, Select and Unset)

  • If you use very advanced environment variables (like PROMPT=%@exec[] ...., ), you might want to wrap this alias in SETDOS /X... commands, like setdos /x-24A & .... & setdos /X0

  • If you don't care for layout, this will do the same:
alias SUNSET=`set |! unset %@word["=",0,%@select[con,1,1,40,100,Unset ...]]`
Last edited: