|
Answer» Is there a dos command that I can PUT in a batch file to do the following?
Delete a directory and all its subs by only indicating part of the directory name. Ex- C:\cisg_proc_041904 (created USING xxcopy) The example has a different date (041904) each time it is created. Want to be able to automatically delete the directory with the OLD date.deltree "C:\cisg_proc_???"
if the above does work you might look for an old version of norton utilities for dos.. I believe it provided a means to delete a directory using wildcard characters. sorry forgot to TURN the tennis ball faces off.
deltree "C:\cisg_proc_??????"you might be having trouble with the long DOS names
i believe you can
look at deltree C:\cisg_pr*.* and i believe that it will work for you I think scruge has the correct syntax, but a word of caution. Make SURE the new directory is not created BEFORE the deltree command. Do not allow the batch file to recurse, and build in some error checking so that the new directory will not be accidentally deleted. Also, make sure you do not have other directories with similar names - beginning with C:\cisg_proc_The deltree command is absent from stock NT/2K/XP DOS emulator. In Win9x, it is available.
Use "quotes" if your file names are not 8.3 valid ones.
deltree "c:\cisg_proc_*.*"
The command creating the current directory should follow this.
|