A
Arjan van den Noort
How to delete a directory (with all containing directories and files) with
vb.net if the directory contains long paths ?
(just like the dos command: RD /S/Q path)
What I want is a routine to delete files and folders from a shared folder
(accessed by its UNC-notation). That's all !
Some path names can be long (> 200 characters ) and there are some files and
folders that can be read-only.
The exceptions I get:
System.IO.File.SetAttributes() has problems with long paths:
PathTooLongException
System.IO.Directory.Delete() has problems with read-only files
(UnauthorizedAccessException) and has also problems with long paths
(DirectoryNotFoundException)
Working with Scripting.FileSystemObject also runs into problems when working
with long path-names.
Any suggestions ?
Regards,
Arjan van den Noort
ITC, Enschede, The Netherlands
vb.net if the directory contains long paths ?
(just like the dos command: RD /S/Q path)
What I want is a routine to delete files and folders from a shared folder
(accessed by its UNC-notation). That's all !
Some path names can be long (> 200 characters ) and there are some files and
folders that can be read-only.
The exceptions I get:
System.IO.File.SetAttributes() has problems with long paths:
PathTooLongException
System.IO.Directory.Delete() has problems with read-only files
(UnauthorizedAccessException) and has also problems with long paths
(DirectoryNotFoundException)
Working with Scripting.FileSystemObject also runs into problems when working
with long path-names.
Any suggestions ?
Regards,
Arjan van den Noort
ITC, Enschede, The Netherlands