In this FAQ feature, let's discuss two generic problems that arise while using Doc-To-Help:

  1. Executing the Modular TOC Utility in an unattended batch operation
  2. HTML help (chm file) displays XML source code

Executing Modular TOC Utility in Unattended Batch Operation

Problem statement

The problem here is to run the Modular TOC Utility in an unattended batch operation. The need arises from the fact that we have several help-projects and a master-help file. We need this to work so that opening one of the chm-files will show the TOC of every help file. This is what the Modular TOC Utility does by modifying every hpp-file and the master hhc-file when running through the commands "Process Modules, Compile Selected Modules, Compile hub module and Compile all modules" on a previously generated master.hub-file.  We would like to do this in an unattended batch build so as to make things easier.


In order to accomplish this requirement, we would need to use the new version of the ModularTOC utility which can be downloaded from here.

Note- The previous version of ModularTOC.exe which is usually located at the following place on one's machine must be backed up and replaced with the new one:
"C:\Program Files (x86)\ComponentOne\DocToHelp\ModularTOCUtility\ModularTOC.exe"

To run the utility in batch mode, execute the following command:
ModularTOC.exe -fix "path-to-hub-file"

HTML Help (chm file) Displays XML Source Code

Problem Statement

When HTML Help generated by DocToHelp is opened on any specific machine then it displays XML source code instead of the original help file. However, the same chm opens correctly on other machines.


This is caused by something breaking part of the .htm file type in the system’s registry. Microsoft’s HTML Help components will go wrong if a particular registry value is set incorrectly.

Automatic fix
You can fix this by double-clicking the .reg file within archive: HTML_Fix_ContentType

Manual fix
In this case, you can edit the registry by hand. This assumes familiarity with RegEdit.exe.

  1. Go to HKEY_LOCAL_MACHINE\Software\Classes\.htm
  2. Ensure there is a Content Type value with Type = REG_SZ (String), and Data = text/html
  3. Go to HKEY_CURRENT_USER\Software\Classes\.htm
  4. If there is no .htm key at that path, or there is one but it has no Content Type value, you are done and can stop.
  5. Otherwise, ensure it is set to text/html as with the HKEY_LOCAL_MACHINE one.

Multiple Users
If the machine has multiple user accounts, you may need to apply the HKEY_CURRENT_USER part of the fix to each account separately.


Please share your comments and feedbacks on the solutions discussed. In case you have any specific problem that you would like us to discuss in our next Doc-To-Help-focused blog, let us know.