- Aug
- 2,293
- 111
I like the /N switch of the PATH command,
which allows me to display each path directory on its own line.
I have duplicated this,
to the best of my ability,
to work with each COLORDIR type/colour on its own line.
Example output;
This display format makes it easier to see what colour I have assigned to what file type.
Joe
which allows me to display each path directory on its own line.
I have duplicated this,
to the best of my ability,
to work with each COLORDIR type/colour on its own line.
Code:
@setlocal
@echo off
:: Batch Name: colordir.btm
Gosub ColorDir2File
Gosub File2ColorDir
defer type %temp\colordir.txt
endlocal
quit
:ColorDir2File
set ColorDirCount=%@words[";",%Colordir]
set ColorDirCount=%@DEC[%ColorDirCount]
if exist %temp\colordir.txt del /q %temp\colordir.txt
do kount=0 to %ColorDirCount
echo %@word[";",%kount,%ColorDir] >> %temp\colordir.txt
enddo
Return
:File2ColorDir
unset colordir
do c in @%temp\colordir.txt (set COLORDIR=%COLORDIR;%c)
::
:: Remove the first ; character
::
set colordir=%@right[-1,%colordir]
Return
Example output;
Code:
R:\>colordir
dll:bri yel on bla
hrb:bri whi on bla
EXETYPE_WIN32CUI:blue
EXETYPE_WIN32GUI:bri blue
EXETYPE_WIN64GUI:bri red
EXETYPE_WIN64CUI:red
EXETYPE_DOS:bri cya
This display format makes it easier to see what colour I have assigned to what file type.
Joe