Using UNC Paths with .NET 4.0

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
 
B

B. V.

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

?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top