Dirhtml Help - Scripts (Variables)

The following variables can be used in /START, /END, /BETWEEN_FILES_AND_FOLDERS, /BEFORE_ANCHORS, /FILE_TABLE_START, /FILE_TABLE_END, /FOLDER_TABLE_START, /FOLDER_TABLE_END, /ANCHOR_TABLE_START, /ANCHOR_TABLE_END and /BEFORE_SUMMARY:

VariableDescription, Use
%%DIR Inserts the fully qualified path (for example: C:\Windows\System)
Note: Works in /PRE_HREF_FILE and /POST_HREF_FILE, and as part of a root folder word
%%FOLDER    Inserts the folder (for example: Desktop)
Note: Works as part of a root folder word
%%ROOT_FOLDER%    Inserts a relative reference to the root build folder (e.g. "../../../../../")
%%RELATIVE_PATH    Inserts the path relative to the root folder (for example: /Desktop/Folder)
%%DATE Inserts the date and time
%%DATE_NO_TIME%   Inserts the date (a trailing % is required)
%%DAY% Inserts the current day
%%MONTH% Inserts the current month
%%YEAR% Inserts the current year
%%TIME% Inserts the current time
%%DATE_MODIFIED% Inserts the date modified string, adjusted for the date format selected on the Miscellaneous page
%%F Inserts the filename, with character codes translated
(Note: only works in /FILE_HREF_APPEND, /PRE_HREF_FILE and /POST_HREF_FILE sections)
%%FNAME% Inserts the filename, untranslated.
This is primarily intended to be used with a /FILE_HREF_APPEND, for example: title="%%FNAME%" (which shows a popup link reference in browsers).
(Note: only works in /FILE_HREF_APPEND, /PRE_HREF_FILE and /POST_HREF_FILE sections)
%%F_PATH Inserts the filename, including the relative path
(Note: only works in /FILE_HREF_APPEND, /PRE_HREF_FILE and /POST_HREF_FILE sections)
%%FILE...% Inserts the contents of a text file.  The filename must be followed by %.
Example:  %%FILEsome_file.txt% inserts the contents of the file named some_file.txt.
Note: Absent a path, dirhtml will look for the file in the folder being searched first, then in the same folder as dirhtml.exe.
%%FILE...% can also be used in an /ANCHOR section or as part of an Anchor Prefix.
%%F_PATH_2SLASH% Inserts the filename, including the relative path, using two forward slashes as folder qualifiers
Note: Works in /PRE_HREF_FILE and /POST_HREF_FILE
%%NO_EXT_FNAME% Inserts the filename with with no extension
This makes it possible to have screenshots point to video or other files with filenames that are identical except the extension.
(Note: only works in /FILE_HREF_APPEND, /PRE_HREF_FILE and /POST_HREF_FILE sections)
%%2SLASHDIR% Inserts the fully qualified path (for example: C:\\Windows\\System\\), with two slashes appended
Note: Works in /PRE_HREF_FILE and /POST_HREF_FILE
%%2FSLASHDIR% Inserts the fully qualified path using two forward slashes (for example: C://Windows//System//), with two forward slashes appended
Note: Works in /PRE_HREF_FILE and /POST_HREF_FILE
%%SUMMARY    Inserts the summary statistics, which can use the /SUMMARY_STYLE script section
%%INCLUDES    Inserts the filenames include string
%%SKIPPED    Inserts the filenames exclude string
%%SPEC Inserts the file specification string
%%VERSION    Inserts the version of dirhtml that created the file
%%FOLDERS_INCLUDE%    Inserts the folders include string
%%COLUMNS% Inserts the number of columns in the current table.  For the file table, columns is automatically adjusted for extra included columns (e.g. size, date, time).
%%COLUMNS% can also be reduced by a specific number by using the form %%COLUMNS-##%", where ## number of columns to be subtracted from the total.  This makes it possible to use script code like the following:
/FILE_TABLE_START
<tr><td colspan="%%COLUMNS-1%" style="text-align: center">All td's except one</td><td>The rightmost td</td></tr>
%%TOTAL_FILES%Inserts the total number of file links
%%TOTAL_FOLDERS%Inserts the total number of folder links
%%TOTAL_FILE_SIZE%Inserts the size of all linked files
%%ANCHOR_TOTAL_SIZE%Inserts the size of all linked files in the subfolder (only valid in /ANCHOR sections)
%%ANCHOR_TOTAL_FILES%  Inserts the number of linked files in the subfolder (only valid in /ANCHOR sections)

%%FILE, %%DIR, %%FOLDER and %%VERSION can also be used in /HEAD.