Microsoft KB Archive/49849

= Deleting Temporary Files Created by MS-DOS Shell =

Article ID: 49849

Article Last Modified on 10/14/2003

-

APPLIES TO


 * Microsoft MS-DOS 4.0 Standard Edition
 * Microsoft MS-DOS 4.01 Standard Edition
 * Microsoft MS-DOS 5.0 Standard Edition

-



This article was previously published under Q49849



SUMMARY
The Microsoft MS-DOS Shell's File System creates a temporary file when a program is run while viewing the directory tree. This file is created to hold the current directory information so that the MS-DOS Shell does not have to search the drive again when the program exits. Upon return to the MS-DOS Shell's File System, the file is retrieved to the MS-DOS Shell's memory, and the file is deleted.

If the computer is rebooted before returning to the MS-DOS Shell, this temporary file is not deleted. The MS-DOS Shell cannot detect and delete this file the next time DOSSHELL is run. Thus, these temporary files build up on the disk whenever a File Run from the MS-DOS Shell File System is not exited properly.



MORE INFORMATION
To produce the temporary file and verify that it is deleted when you return to the MS-DOS Shell, perform the following steps:  Invoke the MS-DOS Shell by typing the following command at the MS-DOS command line prompt:

C:\> DOSSHELL

 Run COMMAND.COM from the MS-DOS Shell File System. List the subdirectory from which the MS-DOS Shell was started. If DOSSHELL.BAT is in the path, this is the subdirectory that you were in when you started the MS-DOS Shell. Remember the name of the file that has no extension and a jumble of seemingly random letters for the filename. Exit COMMAND.COM by typing EXIT at the MS-DOS command-line prompt, as in the following example:

C:\> EXIT

 Press the ENTER key at the &quot;Return to Dos Shell&quot; prompt. If the computer is rebooted instead of pressing the ENTER key at this point, the temporary file is not deleted. Using the File System, select the subdirectory that the MS-DOS Shell was started from to verify that the temporary file has been deleted.</li></ol>

The MS-DOS Shell's File System uses MS-DOS Interrupt 21H Function 5AH (Create Temporary File) to create its temporary file. Since this filename is a function of the current time and date, the MS-DOS Shell never uses the same filename for its temporary file. If these temporary files are not deleted (e.g., a program fails to properly exit back to the MS-DOS Shell), the temporary files collect on the disk, requiring manual deletion.

Additional query words: 4.00 4.01 5.00

Keywords: KB49849

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.