"File.AllFiles(?"c:\test","file.deletenorecycle(_file_)",2)" worked
perfectly.
But, I gotta admit, I played around for 5 minutes wondering why it
wouldn't work when I realized I fogot to change "C:\test" to my
desired directory. ;) Just thought you should know the kind of user
you were dealing with!
Thanks to both of you for your assistance.
--- In [email protected], "swzoh" <[EMAIL PROTECTED]> wrote:
>
> --- In [email protected], Alan Martin <alan_au@> wrote:
> >
> > Hello Ed,
> >
> > > Using the "3" flag did not delete files in subfolders for me.
> >
> > That's strange. I just tested again, making subdirectories
> > 3 levels deep under c:\test and copying a few files into them.
> >
> > File.AllFiles(?"c:\test","file.delete(_file_)",3)
> > destroyed the lot, all files and all dirs except c:\test itself.
> >
> > > The help file states that for subfolder flag "3" requires "(use
> > > file.isfolder to select folders)".
> >
> > It doesn't say "requires", it says "(use file.isfolder to select
> > folders)". I think that means when you want to do different things
> > to folders vs files.
> > I think that in your case you don't need to use file.isfolder
> > because you want the same action (deletion) to be applied
> > to both files and folders.
> >
> > > Deleting just the files in the subfolders is okay for now.
> >
> > Not exactly what you wanted though.
> >
> > I hope someone else reading this can suggest why using
> > 3 as the subfolders flag works for me and not for you.
>
> Maybe the setting if to use the recycle bin for the deleted files is
> different. If the setting is on, file.delete() can't remove non-empty
> folders. To see what's going on, you may use instead:
> File.AllFiles(?"c:\test","win.debug(_file_)++file.delete(_file_)",3)
>
> The following could do the job done:
> File.AllFiles(?"c:\test","file.delete(_file_)",1)
> File.AllFiles(?"c:\test","file.deletenorecycle(_file_)",4)
>
> Or, if there is no need to use the recycle bin, then simply can use:
> File.AllFiles(?"c:\test","file.deletenorecycle(_file_)",2)
>
> Sean
>
Attention: PowerPro's Web site has moved: http://www.ppro.org
SPONSORED LINKS
| Computer monitoring software | Power pro | Computer and internet software |
| Free computer monitoring software |
YAHOO! GROUPS LINKS
- Visit your group "power-pro" on the web.
- To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
- Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.
