Open [ND Dir]/Modules/NaturalDocs/Menu.pm and search for "if ($keyword eq 'file')". Change this:

if ($keyword eq 'file')
{
my $flags = 0;

if ($value =~ /^(.+)(([^(]+))$/)
{
my ($title, $file) = ($1, $2);

  $title =~ s/ +$//;

to this:

if ($keyword eq 'file')
{
my $flags = 0;
my ($title, $file);

  if ($value =~ /^(.+)\(([^\(]+)\)$/)
     {
     ($title, $file) = ($1, $2);
     }
  elsif (defined $comment)
     {
     $value .= $comment;

     if ($value =~ /^([^\(\)]+?) ?\(([^\)]+)\) ?(?:#.*)?$/)
        {
        ($title, $file) = ($1, $2);
        };
     };

  if ($title)
     {
     $title =~ s/ +$//;

This allows # characters in File: entries in Menu.txt using the hack I used to allow them in Link: entries. Now open [ND Dir]/Modules/NaturalDocs/Builder/HTMLBase.pm and search for:

$relativeSourceFile =~ tr/ &?(){};/_/;

Change it to:

$relativeSourceFile =~ tr/ &?(){};#/_/;

This adds # to the list of characters that get replaced with underscores in the output file name. Now run Natural Docs with -r to apply the changes everywhere.