PC Review


Reply
Thread Tools Rate Thread

Directory recursion

 
 
Rex the Strange
Guest
Posts: n/a
 
      11th Mar 2010
Hi everyone,

Surely this isn't that hard:

I'm trying to create a routine which is recursive across the entire
directory structure on a designated drive (from the root directory
through every folder on the drive - system, hidden, the lot).

And I'm getting, when I try:

directoryinfo.getdirectories

on a system folder, the dreaded "unauthorized access exception." I
have set the UAC settings to "requireAdministrator" as one post
suggested. I am running as an administrator (I'm the only user of this
computer). Some posts suggest "impersonation" - but I haven't found an
easy explanation of what this is all about.

Who do I have to kill to get past this? Please help?

tia,
rts
 
Reply With Quote
 
 
 
 
Mike Lovell
Guest
Posts: n/a
 
      11th Mar 2010
> Surely this isn't that hard:
>
> I'm trying to create a routine which is recursive across the entire
> directory structure on a designated drive (from the root directory
> through every folder on the drive - system, hidden, the lot).
>
> And I'm getting, when I try:
>
> directoryinfo.getdirectories
>
> on a system folder, the dreaded "unauthorized access exception." I
> have set the UAC settings to "requireAdministrator" as one post
> suggested. I am running as an administrator (I'm the only user of this
> computer). Some posts suggest "impersonation" - but I haven't found an
> easy explanation of what this is all about.
>
> Who do I have to kill to get past this? Please help?


You shouldn't need to go down impersonation or UAC routes if you're running
as administrator.

What "system" folder are you talking about here?

Also Could you post the code/function?

--
Mike
GoTinker, C# Blog
http://www.gotinker.com

 
Reply With Quote
 
Peter Duniho
Guest
Posts: n/a
 
      11th Mar 2010
Rex the Strange wrote:
> Hi everyone,
>
> Surely this isn't that hard:
>
> I'm trying to create a routine which is recursive across the entire
> directory structure on a designated drive (from the root directory
> through every folder on the drive - system, hidden, the lot).
>
> And I'm getting, when I try:
>
> directoryinfo.getdirectories
>
> on a system folder, the dreaded "unauthorized access exception." I
> have set the UAC settings to "requireAdministrator" as one post
> suggested. I am running as an administrator (I'm the only user of this
> computer). Some posts suggest "impersonation" - but I haven't found an
> easy explanation of what this is all about.
>
> Who do I have to kill to get past this? Please help?


If you don't have the rights to view the directory, you don't have the
rights. This really has nothing to do with .NET, but the bottom line
is: if you want to be able to view every single directory on the disk,
you have to be executing the code with the privileges of a user that has
security access to every single directory on the disk.

Simply running with admin rights may well not be enough, depending on
how the permissions on the disk are configured.

Pete
 
Reply With Quote
 
Göran Andersson
Guest
Posts: n/a
 
      15th Mar 2010
Rex the Strange wrote:
> Hi everyone,
>
> Surely this isn't that hard:
>
> I'm trying to create a routine which is recursive across the entire
> directory structure on a designated drive (from the root directory
> through every folder on the drive - system, hidden, the lot).
>
> And I'm getting, when I try:
>
> directoryinfo.getdirectories
>
> on a system folder, the dreaded "unauthorized access exception." I
> have set the UAC settings to "requireAdministrator" as one post
> suggested. I am running as an administrator (I'm the only user of this
> computer). Some posts suggest "impersonation" - but I haven't found an
> easy explanation of what this is all about.
>
> Who do I have to kill to get past this? Please help?
>
> tia,
> rts


Your code is probably trying to do something like looking inside the
trashcan folder.

Check the attributes of each folder. If it's a hidden system folder,
just skip it.

--
Göran Andersson
_____
http://www.guffa.com
 
Reply With Quote
 
Jeff Johnson
Guest
Posts: n/a
 
      22nd Mar 2010
"Göran Andersson" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...

> Your code is probably trying to do something like looking inside the
> trashcan folder.


Actually, my money's on System Volume Information. Locked down tight as a
drum.


 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Recursion =?Utf-8?B?c2VlbWE=?= Microsoft C# .NET 15 14th Aug 2007 06:27 PM
VB-101 Use of Recursion =?Utf-8?B?Sm9obiBQYXNz?= Microsoft VB .NET 9 18th May 2005 05:54 PM
How to set DNS recursion to no? Lee Microsoft Windows 2000 DNS 4 21st Oct 2004 04:42 AM
Recursion in C# =?Utf-8?B?TWFkV2lsZFNoYXJr?= Microsoft C# .NET 9 20th Mar 2004 12:11 AM
[OT] Get directory structure without using recursion John Baro Microsoft C# .NET 6 12th Mar 2004 04:01 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 02:15 AM.