SWEEP Charles Petzold Command PC Magazine Vol 4, No 23 Copyright 1985 Ziff-Davis Publishing Company ______________________________________________________ Purpose: Causes a command to be successively executed in every subdirectory on a hard disk. Format: SWEEP Command [parameter(s)] Remarks: SWEEP starts from the current directory. In order to use SWEEP to extend the range of a command to all the subdirectories on a disk, use CD (if necessary) to make the root directory your current directory. From the root directory, the command SWEEP DIR will display the listings, by subdirectory, of every non-hidden file on the disk. To erase all the .BAK files on a disk you need only get into the root directory and issue the command SWEEP DEL *.BAK SWEEP itself will not accept parameters other than its command. Thus, if you are on drive C: and wish a directory of all files on drive D: to be sent to your printer, you must first make drive D: the current drive before you issue the command SWEEP DIR > LPT1 (In this case you would either need a copy of SWEEP.COM on drive D: or else drive D: would have to be listed on your PATH.) SWEEP can execute .BAT file commands (and even non-DOS commands, such as LOCATE.COM). A useful file called CLEAN.BAT might consist of the three lines DEL *.BAK DEL *.TMP DEL *.OBJ From the root directory, if you then enter SWEEP CLEAN all .BAK, .TMP, and .OBJ files will be erased from the disk. Notes: 1. Requires DOS 2.0 or later.