Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Accessing Drive but it contains "protected" files

Status
Not open for further replies.

andegre

MIS
Oct 20, 2005
275
US
My sister-in-law has a backup drive that contains all of her files. Her PC recently crashed and we are in the process of trying to restore some of her files. I wrote a program to grab specific files off her backup drive and then copy them back to her machine, but I'm getting an error message when doing Directory.GetFiles(path) that says "System.UnauthorizedAccessException". I've googled that, and all I can find is that it's for ASP.NET stuff and the way to get around it is by changing the permissions on the desired drive. Well, what if I can't do that; I only want specific files off this device, I don't care about the hidden system files. Is there a way to get around this? A try/catch won't work (I don't think); Is there some way to filter when doing a Directory.GetFiles?

TIA
 
Wow, please ignore this thread...I'm embarassed to say that I even program...

Directory.GetFiles(string path, string SEARCHPATTERN)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top