Welcome guest. Before posting on our computer help forum, you must register. Click here it's easy and free.

Author Topic: MS dos commands, deltree ?????  (Read 4484 times)

0 Members and 1 Guest are viewing this topic.

Larry Watson

  • Guest
MS dos commands, deltree ?????
« on: October 19, 2004, 12:57:15 PM »
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.

scruge

  • Guest
Re: MS dos commands, deltree ?????
« Reply #1 on: October 23, 2004, 08:11:24 PM »
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.  

scruge

  • Guest
Re: MS dos commands, deltree ?????
« Reply #2 on: October 23, 2004, 08:15:37 PM »
sorry forgot to turn the tennis ball faces off.

deltree "C:\cisg_proc_??????"

franksimari

  • Guest
Re: MS dos commands, deltree ?????
« Reply #3 on: November 19, 2004, 01:19:45 PM »
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 ;)

2k dummy

  • Guest
Re: MS dos commands, deltree ?????
« Reply #4 on: November 19, 2004, 01:39:28 PM »
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_

MalikTous

  • Guest
Re: MS dos commands, deltree ?????
« Reply #5 on: November 23, 2004, 12:03:04 PM »
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.