Using UNC Paths with .NET 4.0

  • Thread starter Thread starter Anders Eriksson
  • Start date Start date
A

Anders Eriksson

I have a backup program (Cobian Backup 10) that works almost perfectly.
I backup to a second harddrive.

The backup will create a directory structure that makes path longer than
260 characters.

I keep 1 week of full backups.

Here is the problem. Since the backup contains files that are read-only
the backup program can't delete them! So I wind up with a lot of
directories (with structures) that should have been deleted...

I then created a small console program that run through the directory
structure that will be deleted and removed the read-only flag.

Now I get an PathToLong exception.

Question:
Is there someway of using .NET and UNC for doing this or am I forced to
use PInvoke?

// Anders
 
I then created a small console program that run through the directory
structure that will be deleted and removed the read-only flag.

What about: attrib -r /s \\path\to\backups

?
 
Back
Top