[<<]Message[>>]    [<<]Author[>>]    [<<]Subject        [<<]Thread    

Number : 2696 Date : 2002-08-22 Author : Garry Deane Subject : Re: deleting files Size(KB) : 1
--- In xxcopy@y..., "Mike Hazard" wrote: > Is there a way to delete files when they reside in a folder that has the same name but in several different directories. Can I use an If Then statement or what do you suggest to clean out these directories. > Not a problem, just use the wild-wild path specification. Here is an example where we want to delete everything in the \temp\test\*\dir1\ directory regardless of where it exists in the directory tree. I've named the files to be deleted within \dir1\ as "deletethis.txt" and the rest which are to be kept as "keepthis.txt". D:\temp>dir /s/b/a-d test\* D:\temp\test\test1\dir1\Deletethis.txt D:\temp\test\test1\dir2\keepthis.txt D:\temp\test\test2\keepthis.txt D:\temp\test\test2\dir3\keepthis.txt D:\temp\test\test2\dir3\dir1\deletethis.txt D:\temp\test\test3\keepthis.txt D:\temp\test\test3\dir4\keepthis.txt D:\temp\test\test3\dir1\deletethis.txt And here is the xxcopy command. Note that I've used the /L option to list the results as Mel has mentioned. After you're happy that the command will do what you want, just remove the /L. D:\temp>xxcopy /rsy/pd0/l D:\temp\test\*\dir1\* XXCOPY == Pro Edition == Ver 2.80.3 (c)1995-2002 Pixelab, Inc. ----------------------------------------------------------------- D:\temp\test\test1\dir1\Deletethis.txt 0 D:\temp\test\test2\dir3\dir1\deletethis.txt 0 D:\temp\test\test3\dir1\deletethis.txt 0 ----------------------------------------------------------------- Directories processed = 3 Total data in bytes = 0 Files to be deleted = 3 Exit code = 0 (No error, Successful operation) Garry
This message if part of XXCOPY's message Archive. The archive contains all the messages posted at Yahoo!Groups: XXCOPY.