Welcome!

By registering with us, you'll be able to discuss, share and private message with other members of our community.

SignUp Now!

Done Indicate .exe and .dll type in DIR command

Aug
2,308
111
In the Tasks plugin,
the Tasklist command can display extra information about each process,
using the /E switch.

That is,
32-bit programs are marked with a guillemet: » when using the Tasklist command.
1731790380050.webp


Could the DIR command be modified to do the same thing?

That is, add a switch that would display 32-bit programs (.exe) and 32-bit Dynamic Link Libraries (.dll) by marking them with a guillemet: »

Or maybe not a guillemet: »,
as I also want the DIR command to display if the .exe is a Console or GUI executable.

I realize that there is already an /E switch for the DIR command,
so another switch would be necessary.

I am aware that I can do this using the PDIR command,
but incorporating this into the DIR command would be useful.

I am aware that I can use the COLORDIR environment variable,
to indicate if an .exe is a 32-bit Console or 32-bit GUI executable,
but when I do a DIR | VIEW
or a DIR | LIST I don't see the colors.

I'm currently using the following code to determine if an .exe is a Win32 GUI executable,
or a Win32 console executable.

Code:
dir /b *.exe > tmp9:
tmp /c tmp8:
do theFile in @tmp9:
  switch %@exetype[%theFile]
    case 6
      if %1 eq gui echo %theFile Win32 GUI >> tmp8:
    case 7
      if %1 eq con echo %theFile Win32 console >> tmp8:
    default
      echo ` ` >> tmp8:
  endswitch

enddo
:: ffields is a plugin command (TextUtils)
type tmp8: |! ffields

Ref: https://charlesdye.net/dl/tasks.zip
Ref: https://jpsoft.com/help/f_exetype.htm
Ref: https://jpsoft.com/help/dir.htm

Joe
 
How can displaying a specific character for a specific EXE/DLL
be a substantial performance penalty,
when you can display a specific colour for a specific EXE/DLL?

At the present time,
you are using the COLORDIR environment variable
with the DIR command
to determine the type of file to be displayed
in a certain colour.

Could not another environment variable,
say, EXEDIR,
be used to determine what character to display
for a specific type of EXE or DLL file?

Code:
SET EXEDIR= 

DLLTYPE_WIN32:֍
DLLTYPE_WIN64:£
EXETYPE_WIN32CUI:»
EXETYPE_WIN32GUI:¥
EXETYPE_WIN64CUI:§
EXETYPE_WIN64GUI:«
EXETYPE_DOS:±

The directory display symbols that I have presented for use with DIR are examples only.

The symbols could be either fixed, or user-defined.

Joe
 
How can displaying a specific character for a specific EXE/DLL
be a substantial performance penalty,
when you can display a specific colour for a specific EXE/DLL?

Yes - which has a substantial performance penalty. In order to colorize (or to display your special character) TCC needs to open each file and parse the header to determine the type.
 
Back
Top