Microsoft KB Archive/67381

= Deleting Files Based on Creation Date =

Article ID: 67381

Article Last Modified on 11/26/2003

-

APPLIES TO


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

-



This article was previously published under Q67381



SUMMARY
MS-DOS versions before 6.x do not provide a direct means of deleting a file based upon its creation date. However, you can perform this function by using a sequence of MS-DOS commands, executed from the directory in which the files to be deleted reside, as follows:   md newfiles                     (Creates subdirectory NEWFILES)

xcopy *.* newfiles /d:date     (Copies all files from current                                   directory created on or after                                   date to the subdirectory                                   NEWFILES*)

del *.*                        (Deletes all files in current                                   directory)

xcopy newfiles                 (Copies files from NEWFILES to                                   current directory)

del newfiles                   (Deletes all files in subdirectory                                   NEWFILES)

rd newfiles                    (Removes subdirectory NEWFILES)
 * Please note that this procedure requires enough free disk space to maintain two copies of all of the files in the current directory that will be saved.

With MS-DOS version 6.x the final two steps can be replaced with:

deltree newfiles

Additional query words: 3.20 3.30 3.30a 4.00 5.00 noupd

Keywords: KB67381

-

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

© Microsoft Corporation. All rights reserved.