Home All Groups Group Topic Archive Search About

Recursive delete for Directory structure with read-only files

Author
12 Jun 2006 10:57 AM
Peter
Hi All -

Is there a way to delete a directory structure with read-only files in it?
The Directory.Delete() and DirectoryInfo.Delete() methods both throw an
access violation exception if the directory structure contains read-only
diles or sub-dirs.

Thanks,
Peter

Author
12 Jun 2006 12:13 PM
Vadym Stetsyak
Hello, Peter!

P> Is there a way to delete a directory structure with read-only files in
P> it? The Directory.Delete() and DirectoryInfo.Delete() methods both throw
P> an access violation exception if the directory structure contains
P> read-only diles or sub-dirs.

have a look at ( http://www.thescripts.com/forum/thread270312.html )

--
Regards, Vadym Stetsyak
www: http://vadmyst.blogspot.com
Author
12 Jun 2006 12:17 PM
Cowboy (Gregory A. Beamer)
Process object with "RMDIR /S /Q". Will delete the entire directory
structure and it will not ask you anything. Be careful with the power. :-)

Will have to look at .NET objects for an alternative.

--
Gregory A. Beamer

*************************************************
Think Outside the Box!
*************************************************
Show quote
"Peter" <peter@NO-EMAIL> wrote in message
news:%23YskZ6gjGHA.412@TK2MSFTNGP05.phx.gbl...
> Hi All -
>
> Is there a way to delete a directory structure with read-only files in it?
> The Directory.Delete() and DirectoryInfo.Delete() methods both throw an
> access violation exception if the directory structure contains read-only
> diles or sub-dirs.
>
> Thanks,
> Peter
>

AddThis Social Bookmark Button