Preliminary documentation for the HeartWare Commander:

Please remember, that HC is not completely finished yet! Any problems you may encounter is your own fault ;-) and should be reported to the author. There are still some bugs left in the program and not all the functionality that will be in the finished edition is made yet, but enough is made for you to see if you like what I have done so far. Please report any suggestions and error reports to InterNet or All complaints should be sent to /dev/nul.

NOTE: HeartWare commander is *Copyrighted* Software! Private users are granted a license to use it in non-commercial environments. This includes at people's home, but NOT at their jobs! If you want to use HC in a commercial environment you must obtain a license. Contact Keld R. Hansen on one of the above email addresses, then I will get back to you.

Keld "HeartWare" Hansen

The archive support is in many points only available on .ZIP and .ARJ files. "Why?" you ask? Because only .ZIP and .ARJ files can work properly with sub directories AND with indirect files (specified by @ or ! on the command tail). Since I may have a large number of files to process in an archive at any time (f.ex. when copying into or out of an archive) only archive programs which support the '@' (or '!') indirect file approach will be supported by HC. Also, other archive programs store the full path name in the archive instead of storing only the relative path name. F.ex. if you issue the command

	V:\DIR>LHA a -x -r TEST C:\TP\A*.PAS

then LHA will store the name \TP\DIR\AA.PAS, ie. with a leading backslash! If you then issue the command


then they are restored to \TP\ and sub dirs, whereas if you use PKZIP then the command


will store the file names as TP\ and sub dirs and if you then issue the command


then the files are restored to V:\DIR\TP and sub dirs, which makes it possible for HC to restore the files to a temporary, newly created sub directory and then process the files there, ie. HC is able to completely control where the files are restored to if you use PKZIP/ARJ and NOT if you use LHA.

Only PKZIP and ARJ store relative path names AND allow indirect files. Sorry, folks, but until LHA is updated to function like PKZIP and ARJ, then it will not be fully supported by HC.

  Calling syntax;
    HC [<LeftMask> [<RightMask>]] [<Switches>]

  General Switches:
    /TMP=<Dir>   Override auto-detect of temporary directory
    /MAX=<No>    Only allocate room for this number of files in a directory
    /GDF=<File>  Define a global description file or directory
    /NC          Use Norton Commander 3.x compatible keys
    /Q           Quiet mode enable
    /DIR=<Dir>   Override location of DIRTREE.? files
  Memory allocation switches
    /XMS-        Disable use of XMS memory
    /XMS=nnn     Only use nnn K of XMS memory
    /XMS=-nnn    Leave nnn K of XMS memory unused by HC
    /EMS-        Disable use of EMS memory (also /EMS=nnn and /EMS=-nnn)
    /DSK[=<Dir>] Enable use of disk memory (also /DSK=nnn and /DSK=-nnn)
  Screen handling switches
    /CLOCK       Enable on-screen clock
    /WxH         Use specific screen mode (ie. as in /90x28)
    /COL=<File>  Load a specific colour file
    /MONO[-]     Force/Disable monochrome colours
    /1           Start-up in single-column mode
    /PS          Use this switch if your screen flashes when scrolling
    /VESA-       Disable support for VESA extended text modes & VESA graphics
    /SNOW-       Disable snow prevention on CGA systems
  BIOS support switches
    /BIOS        Use BIOS for screen output
    /EGA-        Don't use EGA BIOS function 13h for screen output (only if /BIOS)
    /FASTEGA-    Disable use of FastEGA resident driver
  SoundBlaster support switches
    /FM-         Don't use SBFMDRV even if found resident
    /MIDI-       Don't use SBMIDI even if found resident
    /VOC-        Disable all use of CTVDSK.DRV (ie: force external .VOC player)
  Network related switches
    /NET[:<Usr>] Use another base name for configuration files
    /DTU         Always use another base name - even for local Dir Tree files
  CD-ROM related switches
    /CDROM:<Drv> Define which drives are CD-ROM drives, in case HCs autodetection
  	         should fail (as in /CDROM:OY to tell HC that both O: and Y: are
  	         CD-ROM drives)
    /CDBD=<Dir>  Define a base directory for CD-ROM descriptions (see the section
  	         on CD-ROMs for further explanation)
  Compatibility modification switches
    /DV-         Disable DesqView support
    /TV-         Disable TaskView/OmniView support
    /DDOS-       Disable DoubleDos support
    /VESA-       Disable VESA enhanced text modes support as well as VESA graphic
  	         mode support.

Environment variables

If you have some options that you want enabled at all times in HC, you can create an environment variable called HC and set it equal to all the options you want permanent:


and if you then want to override it occasionally you just do so on the command line...

The BPC environment variable can be used under OS/2 to make HC calculate the correct number of bytes needed for tagged files on HPFS drives, even when the HPFS drive reports 32K cluster size under DOS but only uses 1K cluster sizes. Use it as:

	SET BPC=E:1024,F:1024

which will override the number reported by DOS for drive E: and F: and reset it to 1K per cluster, thus giving you more precise readings.

HC and networks

When running HC.EXE off a network drive, HC will change the names of some of the support files. The HC.LAY, HC.EXT and HC.CFG will now be called .* where is your network logon name (obtained with INT 21h/AX=5E00h). This allows multiple users on a network to have independent configurations.

In case your network doesn't support INT 21h/AX=5E00h to get user logon name, (or if you want to specify an alternate name) you can give a /NET command line switch on the command tail, as in

	HC /NET=MyName

which will make the HC.EXT file be called MYNAME.EXT (etc.) for that session. For convenience, you should include this switch in your HC alias or environment variable.

HC and DesqView

HC is fully DesqView-aware. This means that you do not need to virtualize the screen buffer and can have 'Writes Directly to Screen' set to No.

Unfortunately, due to a design flaw, you may experience some screen update problems when runnig LIST from within HC under DesqView. The technical reason is this:

Whenever DesqView runs, it scans the virtual screen buffer for any changes. Thus you do not need to inform DesqView of any changes to the buffer. However, you *can* do so with INT 10h/AH=FFh (which result in better screen updating), and when DesqView sees this call, it disables the automatic scan.

Unfortunately, this disabling is on the entire session and not only the current program. This means that when HC is running in DesqView and executes another DesqView aware program that *doesn't* use INT 10h/AH=FFh, then the screen won't be updated. This is not a fault of neither HC nor LIST, but of DesqView. It should keep this flag local for each process within a window.

HC and CD-ROMs

One unique feature of HC is the ability to make descriptions of files on CD- ROMs, completely transparent for the user.

Whenever HC detects a drive is a CD-ROM drive, it scans the root directory of the CD-ROM to create a sort of 32-bit CRC of the CD-ROM disk. This should result in a unique 32-bit number for any CD you may care to insert into your CD-ROM drive.

This 32-bit number is then used as the base name for a directory tree list file and a file descriptions file. So if you see some funny files in your HC home directory by the names *.CDD or *.DIR (where '*' is an 8-digit hexadecimal number), then it is files for HCs CD-ROM support.

The *.CDD file contains descriptions for all the files on the CD-ROM in standard FILES.BBS format, but instead of only having the file name as the first word, the complete path to the file is listed. That way HC is able to keep all the descriptions in a single file.

For use with SysOps that put CDs for download on their BBS, HC can also use a FILES.BBS file for each directory. The FILES.BBS is placed in a subdirectory by the same name as the subdirectory on the CD. This subdirectory is a sub- directory under a directory named *.CDD where '*' is the 32-bit CRC. An example will clarify it:

The file on the CD-ROM that you want to describe is called


and the CRC of your CD is 12349876. The complete name of the FILES.BBS file is then


where <BaseDir> is the directory specified on the command tail with /CDBD, or HC's home directory if no /CDBD switch is defined.

As a last possibility, HC can also work in multi-file mode. In this mode, each directory has its own FILES.BBS style file in the .CDD directory. F.ex. the above mentioned file would be described in


Any directory with an extension (such as Y:\SATURN\FILES.ALL\TITAN.ZIP) would retain that extension in the description file (which would then be <BaseDir>\12349876.CDD\FILES.ALL). The root directory is treated in the same way as a subdirectory named ROOT would be, ie. Y:\PACKAGE.LST would have its description stored in


In case HC can't auto-detect your CD-ROM drive(s), you can create an environ- ment string CDROM which contains the letters that are CDROM drives, or you can use the command line switch of the same name. Below is an example of both methods:


Both of these will tell HC that your O: drive and your Y: drive are CD-ROM drives and should be treated as such (ie. the disk should be perceived as R/O media).

Colour file AutoLoad

HC will auto-load colour file HC.MDA on Monochrome systems (or VGA/EGA cards in Monochrome modes), HC.VGA on VGA systems, HC.EGA on EGA systems, HC.CGA on CGA systems or HC.COL if none of the above is found. Auto-loaded colour files must be located in the same directory as HC.EXE

When running off a network, HC will search for .MDA before HC.MDA and likewise for all the other files. The priority is therefore:

	/COL file  if /COL specifies an existing file
	<User>.MDA if Monochrome Display Adapter and running from network
	<User>.CGA if Colour Graphics Adapter and running from network
	<User>.EGA if Enhanced Graphics Adapter and running from network
	<User>.VGA if Video Graphics Array and running from network
	<User>.COL if running from network
	HC.MDA	   if Monochrome Display Adapter
	HC.CGA	   if Colour Graphics Adapter
	HC.EGA     if Enhanced Graphics Adapter
	HC.VGA     if Video Graphics Array

User-defined extensions

You can create a file (HC.EXT) in the same directory as HC.EXE which tells HC which external command should be executed on which files. The format of this file is:

<FileMask>[,<Offset>=<Data>,<Data>]: <Command>

as in

*.CFG:		EDIT %1

which will execute the batch file/alias EDIT when you press <RETURN> on a file matching the *.CFG file mask.


*.ZIP,0="PK",03h,04h:	PKZIP -v %1

which will execute PKZIP -v on all *.ZIP files that has the first four bytes as the two letters "PK" followed by a byte of 3 and a byte of 4. You can specify hexadecimal numbers both as $4A 0x4A or 4Ah. Please note, that you can only override recognized archive formats if you are *not* regarding archives as directories.


*.*,0="Gif89a":		CSHOW %1

which will execute CSHOW on all files that has the string "Gif89a" as the first 6 bytes of the file.

An entry of *.* without any qualifier will be used on all the files that neither you nor HC has explicit support for, as in:

*.*:			LIST %1

which will execute LIST on all the files that you haven't defined explicit information for and that HC doesn't know about either.


In the command to be executed, you can use the following constructs:

	%1 = Full name of file (Disk, ':', Directory, Name, '.' and Extension)
%@NAME[%1] = Name part (ie. no extension, and no '.') of file
%@PATH[%1] = Path part (ie. Disk + Directory) of file (including trailing '\')
 %@EXT[%1] = Extension (without '.')
%@DISK[%1] = Disk drive + ':'

you can also use the following NC compatible notations:

	!.! = %@NAME[%1].%@EXT[%1]
	  ! = %@NAME[%1]
      !\!.! = %1
      !:!.! = %@DISK[%1]%@NAME[%1].%@EXT[%1]

The commands will be executed in the directory where the file is located, ie. you do not normally need a full path of the name. Normally "!.!" will be quite sufficient.


Calling syntax:

ScanMode is a program that scans through all your VGA cards screen modes, noting which modes are which text resolutions. This information is then saved in a file that all programs (HeartWare and others) can use to change mode.

If you have an SVGA card with a VESA driver that supports high-resolution text modes, you do not need to do anything else. You can see if you have such support by running SHOWMODE. If you see any screen modes not 80, 90 or 94 characters wide, then you don't need to run SCANMODE.

You must create an environment variable - MODEINFO - and point it to a directory where you want to store the mode info file. Then run ScanMode and let it run through all the modes on your VGA card and update the file.

When ScanMode has finished, you can use the syntax /WxH in HC to switch to a specific text resolution before starting up HC. You can use ShowMode to show you what modes are supported by your screen card after running ScanMode.

If you have an SVGA card with extended text modes and ScanMode doesn't find them, then you can start ScanMode with the command line switch /LOG which will create the file SCANMODE.LOG in the same directory as SCANMODE.EXE and will log some information that can help me in diagnosing the problem. Send it to me on the BBS (the number is listed in the 1st paragraph).

You can also create the ModeInfo.Dat file yourself. The format is as follows:

  ModeInfo = RECORD
	       Version	: BYTE (6)
	       ModeData	: ARRAY[1..nn] OF RECORD
					    Mode   : BYTE
					    Width  : BYTE
					    Height : BYTE
					    Reserv : ARRAY[1..3] OF BYTE (0)

ie. the first byte must be 6 and then comes a bunch of records each 6 bytes long, where the first byte in the record is the mode number, the second one is the screen width and the third one is the screen height. You must then follow these three bytes with three bytes of zero before you continue with the next mode.


ShowMode is a program that shows you which screen modes HeartWare programs support. If you have a VGA and run it before ScanMode, then only the modes that are possible on a standard VGA card is shown, whereas if you run it after ScanMode, then it will show the modes that ScanMode found as well.


SetMode is a program you can use to switch into one of these high-res text modes. The calling syntax is quite simple:

	SetMode <Width>x<Height>

as in

	SetMode 90x28

If you run SetMode without any parameters, then it will show you some info about your current mode.


Calling syntax:
HCSETUP [<ColourFile>] [/WxH]

Colour installation program. Should be self-explanatory. Please note, that not all colour values are configurable at this point.

HCSETUP automatically switches into 100x40 text mode (if your card supports it AND you have run ScanMode or have a VESA BIOS extension installed that supports enhanced text modes). If your monitor isn't compatible with that resolution (800x600 pixels) then you must override the auto-detect mode at startup with /80x28 or any other screen mode your card supports that has at least 28 lines.

Revision History

0.70 14/07/93 Added support for SQZ archives.
Made changes to allow better support for archivers that doesn't allow indirect files. You can now copy files into and out of and delete files in archives made by archivers that doesn't support indirect files if the file names can be placed on the command line instead.
HeartWare Graphics Pictures now recognized (executes VHGP <FileName>)
In SingleColumn mode, HC now displays the amount of disk space required to copy the files to the other side as well as the amount of disk space that will be left afterwards.
0.71 28/07/93 F5 in NC mode (same as F11 in HC mode) now works with copying into and out of archives.
/DIRECT allows direct, low-level access routines to be used on all DOS disks. This option is forced off when running under a recognized multi tasker (such as DesqView, OS/2 and Windoze).
14/08/93 Fixed problem with playing .VOC files if your Sound Blaster was configured different than the factory default.
0.72 09/11/93 Now reports to user if insufficient memory to execute external program.
0.73 21/11/93 "HC Y: Z:" where Y: doesn't exist now works
29/11/93 Entering directories with extension '.ZIP' or other archive extensions now allowed.
02/12/93 Pressing <RETURN> on archive files with an unrecognizable file extension would give the old-style archive viewer, regardless of setup
29/12/93 Speeded up PickDirectory function by using intelligent scrolling and fast lookup.
03/01/94 Fixed EMS memory bug in XMEM handler.
0.74 04/01/94 /NET switch for network support
0.75 15/01/94 Faster Graphical Directory Tree handling due to internal caching of directory names.
27/01/94 Directory tree files max length increased from 1024 to 4096 lines.
31/01/94 Implemented support for 94xNN modes and NNx60 modes on standard VGA.
0.76 27/02/94 Now supports VESA text modes. If you have a VESA driver loaded that supports text modes, then you probably don't need to run SCANMODE.
The /DIRECT option made problems on some machines, so it has been removed for now...
02/03/94 Added /CLOCK switch
0.77 31/03/94 Various new internal switches
26/05/94 Added CtrlF10/CtrlRet command to execute user-entered command on tagged files.
Improved internal handling of certain commands to better work when inside an archive.
0.78 08/06/94 Added /CLOCK debug capability
01/07/94 Changed meaning of /PS switch a bit
04/07/94 Improved handling of trying to determine a legal directory in case of an illegal one encountered.
ESC is now able to abort comment reading when entering a directory and when rescanning the directory tree.
0.79 26/08/94 Support for file descriptions on CD-ROM drives.
See the section about CD-ROMs for details.
0.80 07/09/94 RAR archive support implemented.
06/10/94 F8 in SubDirs in Archives fixed.
0.81 11/10/94 New configuration system implemented. Allows room for more configuration items, which will be implemented as we come along.
New configuration item: Sort by Size.
New configuration item: Sort Ascending/Descending
0.82 12/10/94 New configuration item: Format Prog AUTO
13/10/94 When .LAY file was corrupted, HC would hang. Fixed.
23/10/94 OS/2 DosBox fix: FindFirst with SearchAttr=$3F would also find volume labels, contrary to DOS specification. Worked around this one...
31/10/94 Added support for other name than DESCRIPT.ION as 4DOS description files (by looking up the name in your 4DOS.INI file's DescriptionName directive.
0.83 08/11/94 Made "BEEP"s at attempts to write to a CD-ROM drive.
0.84 16/11/94 Fixed F8 in archives leaving strangely named directories behind.
0.85 20/11/94 Configuration items can now be selected directly with keys '1' through '9' for easy macro key programming.
21/11/94 F8 function outside archives was screwed up by the fix at 16/11/94. Fixed.
0.86 08/02/95 More relaxed parsing of HC.EXT file
Now able to interrupt copy/hurl with ESC
22/02/95 Copying & Deleting files in archives starting with "-" now handled via indirect files where possible to prevent archive program from interpreting the file name as a switch.
24/02/95 Files with a size of >=100.000.000 bytes are now shown in the list as nnnn Mb and the size is stored internally for correct showing on "Tagged File Size".
0.87 27/03/95 /SAFE switch implemented
0.88 11/07/95 Internal .GIF viewer implemented
28/08/95 Internal .BMP viewer implemented
31/08/95 Compressed .BMP files (.RLE) now supported
25/09/95 .JPG viewing now possible via conversion to .GIF with either JPG2GIF or IMAGE ALCHEMIST
10/11/95 Directory size scanning in AltF10 directory view
0.89 01/12/95 .LONGNAME attributes now supported on FAT drives under OS/2 Warp (appears as comments)
Smearing of interlaced images now allowed
First Overlay version
0.90 08/12/95 Built-in .ZIP uncompressor, courtesy of Asynch Professional 2.0 from TurboPower Software.
20/12/95 Ctrl-PgUp function like in 4DOS
0.92 08/01/96 Released beta version
0.93 22/08/96 BPC environment variable introduced
Disks > 2Gb now supported (disk free and disk total now "stops" at 2 Gb).
0.94 21/12/96 Internal JPG viewer now implemented


Thanks to Sverre Eplov for the design of the Directory Tree Scanning function.

Thanks to Ping Hansen for showing me how to make 94-character modes and how to make 60-lines mode on a standard VGA card.

Thanks to Sean Wenzel for his GIF decoding routine, upon which the one in HC is based.

Thanks to Max Maischein for his BMP decoding routine, upon which the non-RLE viewer in HC is based.