FileInfo plugin for Take Command / TCC / TCC/LE

Version 1.0.16     2025-09-23

Charles Dye

Purpose:

This plugin implements a single command, FILEINFO. I have just copied the one command from my FileUtils plugin and made it available as a standalone plugin.

Installation:

To use this plugin, copy FileInfo.dll to some known location on your hard drive. (If you are still using the 32-bit version of Take Command, take FileInfo-x86.dll instead of FileInfo.dll.) Load the .DLL file with a PLUGIN /L command, for example:

plugin /l c:\bin\tcmd\test\fileinfo.dll

If you copy this file to a subdirectory named PlugIns within your Take Command program directory, FileInfo will be loaded automatically when TCC starts.

Plugin Features:

New Command:
FILEINFO

Syntax Note:

The syntax definitions in the following text use these conventions for clarity:

BOLD CODEindicates text which must be typed exactly as shown.
CODEindicates optional text, which may be typed as shown or omitted.
Bold italicnames a required argument; a value must be supplied.
Regular italicnames an optional argument.
ellipsis…after an argument means that more than one may be given.

Examples are shown in a gray box:

rem   This is an example:
fileinfo *.txt;*.cpp


Some command options take an argument. These are shown with a colon between the option and its argument: /A:arg

If you like, you may substitute an equals sign for the colon: /A=arg This is handy if the arg is a filename, and you want to use tab completion to enter the filename.

Or you can omit the colon: /Aarg

New Command:

FILEINFO — Display information about files.

Syntax:
FILEINFO /A:attribs /C:hash /D /N:flags /O:flags /P /S /T:flags /[range] file…

/A:attribsfilter by attributes
/C:hashchecksum and hash algorithms; see below
/Ddisable highlight
/N:flagsdisable features; see below
/O:flagsomit features; see below
/Ppage output
/Slook in subdirectories for matching files
/T:modetime display mode; see below
/[range]many range options are supported
filewildcards, directory aliases, include lists, and @file lists are supported

FILEINFO displays information about files; go figure. By default, the information shown includes the full, canonical filename; any version information; any TCC file description; the file size, date and time stamps, and attributes; CRC32 and MD5 checksums; 4DOS file descriptions; executable types; Windows properties; and document summary information.


/N: disables features. These flags can be combined:

Cdisable highlight
Ddo not search into hidden directories
Fsuppress file-not-found errors
Jdo not search into junctions
Zdo not search into system directories

/O: omits classes of information. These flags can be combined:

Aomit attributes
Comit checksums
Domit file descriptions
Eomit text file encoding
Fomit TTF font info
Homit file version header
Iomit image file info
Lomit link targets
Nomit NTFS streams info
Pomit Windows properties
Qdo not use fancy Unicode quotes
Romit file type information
Somit document summary information
Tomit time stamps
Udo not resolve AppX execution aliases or symlinks to .exe files
Vomit version information
Xomit executable information
Zomit sizes

Omitting information can make the command faster and reduce the amount of text that is displayed. In particular, computing checksums for very large files can be slow; using /OC will save this time.


/C: specifies the type of checksum or hash displayed by FILEINFO. The available algorithms are:

CRC32CKSUMMD5
SHA1SHA256SHA384
SHA512

You can give more than one, separated by commas. If no /C: is given, the default is /C:CRC32,MD5.


/T: selects which time stamps to display, and how to show them. Flags may include:

Ashow the last-access time stamp
Cshow the creation time stamp
Mshow the last-modified time stamp
Ddefault: localize time stamps as TCC and CMD.EXE do
Llocal times, taking DST time changes into account
UCoordinated Universal Time
Fshow fractional seconds; the default is not to show them

A, C, and M may be combined. If none is given, the default is to display all three time stamps. Only one of D, L, and U should be given; the default is D.


fileinfo "%_cmdspec"



Reference Information:


Paging Options:

FILEINFO has a /P option to page output. This option supports two suboptions:

/P:time,lines

timetime in seconds, or (with a trailing M) milliseconds
linesnumber of lines to display before pausing

Both time and lines are optional. The colon is not required, but you must use the comma if you want to specify lines.

rem  Scroll every five seconds:
fileinfo /p:5

rem  Display ten lines at a time:
fileinfo /p:,10

rem  Display twenty lines at a time, and
rem    scroll every 2.5 seconds:
fileinfo /p:2500m,20


At the “Press a key to continue” prompt, most keys will advance by another screenful (or lines). But a few keys behave differently:

A or Cturns off paging, and scrolls continuously
Esc or Ctrl-Caborts the current command
/scrolls half a screen, or half of lines
1 to 9scrolls that many lines, e.g. 3 scrolls three lines

Ranges:

This plugin supports the following range syntax:


Size range:  /[Ssmallest,largest]

You may omit either smallest or largest. You may qualify either with a trailing letter: lowercase k, m, g, etc. to multiply by one thousand, one million, one billion, and so on; or uppercase K, M, G, etc. to multiply by 210, 220, 230, and so on. If largest begins with a + sign, it is an increment over smallest. Use /![Ssmallest,largest] to invert the test and return only files not in the given size range.

Date range:  /[D[acw]:earliest,latest]

You may omit either earliest or latest; either defaults to the current date. The optional [acw] argument selects the date stamp to check. (If you want to check more than one date stamp, you must supply more than one date range option.) The colon after the [acw] is optional.

Dates may be given in the local date format, or in yyyy-mm-dd format (with a four-digit year). You may also specify a date as an offset preceded with a + or - sign; the offset is in days relative to today’s date (for earliest) or relative to earliest (in the case of latest). If earliest turns out to be later than latest then the two are exchanged.

You may also give a specific time on either date, preceded by an @ sign. The time may be in either 24-hour format, or 12-hour format with a trailing A or P.

Use /![D[acw]:earliest,latest] to invert the test and return only files not in the given date range.

Time range:  /[T[acw]:earliest,latest]

You may omit either earliest or latest. The optional [acw] argument selects the time stamp to check. (If you want to check more than one time stamp, you must supply more than one time range option.) The colon after the [acw] is optional. Times may be in either 24-hour format, or 12-hour format with a trailing A or P.

Use /![T[acw]:earliest,latest] to invert the test and return only files not in the given time range.

Exclusion range:  /[!wildspec]

Filenames matching the wildspec will be excluded. You can supply more than one wildspec by separating them with (unquoted) spaces.

Owner range:  /[Owildspec]

Files whose owners (in domain\user format) do not match the wildspec will be skipped. Use /![Owildspec] to invert the test and return only files which do not match the owner wildspec.

Description range:  /Iwildspec or (alternate syntax) /[Iwildspec]

If a file’s description does not match the wildspec, it will be skipped. Use /!Iwildspec to invert the test, returning only files which do not match the description wildspec.

Day-of-the-week range:  /[W[acw]:days]

You may specify multiple days separated by commas, e.g. /[W:MON,WED,FRI]. You can also give a range, for example /[W:TUE-FRI]. WEEKENDS is accepted as a synonym for SAT,SUN; WEEKDAYS is a synonym for MON-FRI. The colon in this syntax is required.

You may supply multiple ranges. A file must match all given ranges or it will be skipped.

Highlight Variable:

FILEINFO features highlighted output. You can customize this feature by setting an environment variable Highlight:

rem  Disable highlight:
set highlight=none

rem  Set the highlight foreground:
set highlight=bright cyan

rem  Set both foreground and background:
set highlight=bri whi on blu

rem  Numbers are also supported:
set highlight=46

If the Highlight environment variable is not defined, the plugin will check the registry for a value named Highlight of type REG_SZ. The plugin will search, in this order:

•  HKEY_CURRENT_USER\Software\JPPlugins\FileUtils(affects this plugin only)
•  HKEY_CURRENT_USER\Software\JPPlugins(affects several of my plugins)

FILEINFO also has a /D option to disable highlighting.

Startup Message:

This plugin displays an informational line when it initializes. The message will be suppressed in transient or pipe shells. You can disable it for all shells by defining an environment variable named NOLOADMSG, for example:

set /e /u noloadmsg=1

Changes:


Version:Date:Changes:
1.0.16.52025-09-23Now accepts /T:W as a synonym for /T:M, for compatibility with DIR.
1.0.16.42025-09-18Updated versions of conlist.cpp, FileHandler.cpp, and MMFiles.cpp.
1.0.16.32025-08-08Another VLFN tweak: Use FH_AppendFilename() not AppendFilename().
1.0.16.22025-08-05DisplayFileVerHeader() can also pick up TTF font file info.
1.0.16.12025-08-04DisplayFileAttributes() also attempts to display the name of the file’s owner.
Preliminary support for very long filenames (VLFNs).
1.0.16.02025-08-01Now shows TTF font info; /OF to disable.
1.0.15.02025-06-26Now shows NTFS streams info; /ON to disable.
1.0.14.52025-04-24Added a check for a NO_COLOR environment variable. If NO_COLOR is defined and Highlight is not, highlighting is disabled, the same as if /D had been specified.
1.0.14.42025-04-22DisplayLnkTarget() also shows executable info for .scr and .dll files.
1.0.14.32025-04-17DisplayLnkTarget() also shows the FileDescription string if available. If there is a FileVersion string, that is shown in preference to the binary file version.
1.0.14.22025-04-16DisplayLnkTarget() also attempts to display EXE type info for the target executable.
1.0.14.12025-04-09DisplayLnkTarget() also attempts to display version info for the target executable, if any.
1.0.14.02025-04-04Added /TF show show fractional seconds (milliseconds).
1.0.13.22025-03-29Removed the extra blank line introduced by the last update.
1.0.13.12025-03-29When displaying the target of a .lnk file, if the target is an .exe file with a size of zero, check for an AppX alias and show that too if found.
Added quotes around AppX alias targets.
1.0.13.02025-03-27Added some more text file types: .bat .btm .cmd .css .csv .h .htm .ini .xml.
Minor code tweaks.
1.0.12.02025-03-25For text file types, also display the line count and EOL type.
1.0.11.62025-01-06If the file’s Open command is just “%1”, don’t bother to display it.
1.0.11.52024-12-28Now displays file type info; /OR to disable.
1.0.11.42024-12-05DisplayAppXTarget() also chases symlinks as well as AppX aliases (unintended feature). So roll with it! When following a symlink to an executable, prefix the symlink target with “Symlink:” instead of “AppX alias:”.
1.0.11.32024-12-03The numeric file version is now displayed as “Version (binary)” to distinguish it from the version info strings.
1.0.11.02024-10-03Use fancy Unicode quotes around the file description string and link target; /OQ to revert to plain old ASCII quotes.
1.0.10.42024-10-01ParseInt() now supports octal numbers with a leading 0o. Changed http:// to https:// in the PLUGININFO block.
1.0.10.32024-09-09Do not report “access denied” errors on FindFirstFile().
1.0.10.22024-07-26When resolving AppX aliases, check that the target file’s size is greater than zero.
1.0.10.12024-07-23Workaround for GetBinaryType() sometimes returning ERROR_ACCESS_DENIED for Windows Store apps.
1.0.10.02024-07-19Added the ability to resolve AppX execution aliases; use /O:U to disable.
1.0.9.32024-02-07Reworked and simplified the code that displays file hashes.
1.0.9.22024-02-05Added /C: to select which checksums/hashes to compute and display.
1.0.9.12024-01-31Added /T:ACM to select which time stamps to display.
1.0.9.02024-01-29Adds text file encoding, .LNK file targets. Enabled @file lists.
1.0.8.22024-01-17DLL files may have any subsystem value, so long as it isn’t zero.
1.0.8.12024-01-10Added /N? to show help text for /N suboptions.
1.0.8.02024-01-03Changes for conlist v1.1, to better support Ctrl-C and Ctrl-Break.
Check for display strings containing only whitespace, and don’t display them. (Why would anyone do this?)
1.0.7.22023-12-17If the EXIF date stamp looks valid, display it in the same format as other date stamps in this command, including day of the week.
1.0.7.12023-12-16Removed the #include "ImgInfo.cpp" Fixed FileInfoCmd.cpp so it can be successfully compiled either with or without ImgInfo.cpp.
1.0.7.02023-12-15Added /T: to set the time stamp display mode. Added ability to show time stamps as UTC. Fixed a possible memory leak with /O?
1.0.6.12023-12-15DisplayFileTimeStamps() and DisplayFileAttributes() : If the usual methods of getting info fail, try reading from the directory instead.
1.0.6.02023-12-14Explicitly #include "ImgInfo.cpp".
Summary item names get a field length of 24, the same as version info, image file info, and Windows property names. Added "32-bit DLL file" and "64-bit DLL file" executable type strings. Added a bit more sanity checking to FI_ParseExeHeader().
1.0.5.22023-12-14Fix for DisplaySummaryInfo() not correctly returning USER_ABORT when the user did in fact abort. Renamed this file to FileInfoCmd.cpp.
1.0.5.12023-10-10Tweaked the help text to mention the existence of /O?
1.0.5.02023-09-21Added executable type info, and /O:X to disable it. Added /O? to show help text for /O suboptions.
1.0.4.22023-08-28Defined filename args as constant types.
1.0.4.12023-08-01Fixed a possible memory leak on user abort.
1.0.4.02022-03-17Added support for System.Music.TrackNumber.
1.0.3.22022-03-10Renamed the “not available” string.
1.0.3.12022-03-04Now I’m calling them “Windows properties” instead of “shell properties”. No changes to functionality.
1.0.3.02022-03-03Added support for some shell properties; /O:P to disable.
1.0.2.02022-03-02Added image file info; /O:I to disable.
1.0.1.02022-03-01Rewritten to use newer versions of FileHandler.cpp and conlist.cpp. Added /D and /NC to disable highlight. Help text is now displayed via ShowCmdHelp().
1.0.0.02021-09-14

Status and Licensing:

This plugin is © Copyright 2025, Charles Dye. Unaltered copies of the binary and documentation files may be freely distributed without restriction. I make no guarantee and give no warranty for its operation. If you find a problem, you can report it in the JP Software support forum.

Download:

You can download the current version of this plugin from https://charlesdye.net/dl/fileinfo.zip.