diff --git a/html/src/TDocDirective.cxx b/html/src/TDocDirective.cxx
index 2bb9105bff8c8c5e75dbe21cf2578d6ccaa8ff12..9fe26b3065567190b5af561bb40bf4739503fe9d 100644
--- a/html/src/TDocDirective.cxx
+++ b/html/src/TDocDirective.cxx
@@ -460,9 +460,11 @@ Bool_t TDocMacroDirective::GetResult(TString& result)
    }
 
    TString subProcInputFile = CreateSubprocessInputFile();
+   if (subProcInputFile.IsEmpty()) return kFALSE;
+
    subProcInputFile.ReplaceAll("\\", "\\\\");
    subProcInputFile.ReplaceAll("\"", "\\\"");
-   TString invoc("root.exe -l ");
+   TString invoc("root.exe -l -q ");
    if (wantBatch) {
       invoc += "-b ";
    }
@@ -473,7 +475,8 @@ Bool_t TDocMacroDirective::GetResult(TString& result)
 
    if (exitCode && gDebug > 0) {
       Info("GetResult()", "Subprocess exited with status %d\n", exitCode);
-   } else {
+   } else if (!fIsFilename) {
+      // we have created the input file.
       gSystem->Unlink(subProcInputFile);
    }