Files Left Open Using CALL Command on .EXE File (83895)



The information in this article applies to:
    Microsoft MS-DOS operating system 5.0
    Microsoft MS-DOS operating system 5.0a
    Microsoft MS-DOS operating system 6.0
    Microsoft MS-DOS operating system 6.2
    Microsoft MS-DOS operating system 6.21
    Microsoft MS-DOS operating system 6.22

This article was previously published under Q83895

SYMPTOMS

If you use the CALL command in a batch file to execute an .EXE file and use appending redirection (>>) to save the output to a report file, files remain open for the number of times the redirection is used.

WORKAROUND

Remove the CALL command from the batch file. The CALL command should only be used in batch files as described on page 377 of the "Microsoft MS-DOS User's Guide and Reference" for version 5.0, and MS-DOS online help for versions 6.0 and 6.2.

MORE INFORMATION

The above has been verified using Quarterdeck Manifest version 1.1.

The following example batch file and steps demonstrate the problem:

    Create a TEST.BAT file (substitute your Quarterdeck directory for C:\QDECK):
          ECHO **MANIFEST REPORT FILE**   >  C:\QDECK\REPORT.DAT
          CALL C:\QDECK\MFT S O           >> C:\QDECK\REPORT.DAT
          CALL C:\QDECK\MFT S C           >> C:\QDECK\REPORT.DAT
          ECHO **END OF REPORT FILE**     >> C:\QDECK\REPORT.DAT
    

    Execute Manifest MFT.EXE and check number of files open under the DOS section.
    Run TEST.BAT.
    Execute Manifest MFT.EXE and check number of files left open after the batch file has run.
There should be two more files left open (both REPORT.DAT) in step 4 than were in step 2. Adding more (CALL C:\QDECK\MFT >>) to the batch file or running the TEST.BAT file again will cause more files to be left open. To close the open file handles, you will have to restart your system.

Modification Type: Major Last Reviewed: 5/12/2003
Keywords: KB83895