Home All Groups Group Topic Archive Search About

System Volume Information

Author
29 Mar 2006 9:01 PM
TyBreaker
Hi, I'm iterating through the folders on my system and am getting an
exception with "System Volume Information".  Obviously it's a region I'm
not supposed to access so I'm trying to filter it out by checking for
the folder name before trying to use it:

If Folder.Name <> "System Volume Information" Then
   GetFolderDetails(Folder)
End If

But for some reason the if statement is not matching and I'm getting a
run time exception within my GetFolderDetails because it is trying to
access the files in that folder.  Can anyone explain why it doesn't get
caught by my if?
--
  ______     ___               __
/_  __/_ __/ _ )_______ ___ _/ /_____ ____
  / / / // / _  / __/ -_) _ `/  '_/ -_) __/
/_/  \_, /____/_/  \__/\_,_/_/\_\\__/_/
     /___/

There are 10 types of people in this world; those who understand the
binary numbering system and those who don't.

There's no place like 127.0.0.1.

ASCII a silly question, get a silly ANSI.

Author
30 Mar 2006 4:57 AM
Stephany Young
First of all, what is the value of Folder.Name when you hit the folder in
question?

I notice that I can access the 'System Volumne Information' folder on my
stystem drive but not on any of my other local hard drives where I get an
'Access Denied'.

Wrap your GetFolderDetails(Folder) call in a try catch and handle the
exception.


Show quoteHide quote
"TyBreaker" <tybreakerNO@SPAMhotmail.com> wrote in message
news:%23fPh0P3UGHA.5468@TK2MSFTNGP14.phx.gbl...
> Hi, I'm iterating through the folders on my system and am getting an
> exception with "System Volume Information".  Obviously it's a region I'm
> not supposed to access so I'm trying to filter it out by checking for the
> folder name before trying to use it:
>
> If Folder.Name <> "System Volume Information" Then
>   GetFolderDetails(Folder)
> End If
>
> But for some reason the if statement is not matching and I'm getting a run
> time exception within my GetFolderDetails because it is trying to access
> the files in that folder.  Can anyone explain why it doesn't get caught by
> my if?
> --
>  ______     ___               __
> /_  __/_ __/ _ )_______ ___ _/ /_____ ____
>  / / / // / _  / __/ -_) _ `/  '_/ -_) __/
> /_/  \_, /____/_/  \__/\_,_/_/\_\\__/_/
>     /___/
>
> There are 10 types of people in this world; those who understand the
> binary numbering system and those who don't.
>
> There's no place like 127.0.0.1.
>
> ASCII a silly question, get a silly ANSI.
Author
30 Mar 2006 8:42 AM
TyBreaker
Stephany Young wrote:
> First of all, what is the value of Folder.Name when you hit the folder in
> question?

Well according to the break point I have in my GetFolderDetails routine,
the argument passed to the routine is the string "System Volume
Information" which is why I'm puzzled that my if statement doesn't catch
it.  I shall double check with some debugging output.

> Wrap your GetFolderDetails(Folder) call in a try catch and handle the
> exception.

If I have to use Try...Catch I will but I dislike that particular
construct as it tends to hide where errors are coming from so was hoping
to use an if statement to make it obvious as to why I did it.

--
  ______     ___               __
/_  __/_ __/ _ )_______ ___ _/ /_____ ____
  / / / // / _  / __/ -_) _ `/  '_/ -_) __/
/_/  \_, /____/_/  \__/\_,_/_/\_\\__/_/
     /___/

There are 10 types of people in this world; those who understand the
binary numbering system and those who don't.

There's no place like 127.0.0.1.

ASCII a silly question, get a silly ANSI.
Author
30 Mar 2006 10:20 AM
José_Manuel_Agüero
Hello TyBreaker,

There can be a number of folders you can't access on any volume. Even the System Restore folder can have a different name than System Volume Information.
So you should trap any exception while accessing the file system. In your case, you can use something like this:
Try
    GetFolderDetails(Folder)
Catch ex As UnauthorizedAccessException

    'Do something, like maintain a list of inaccesible folders.

End Try



Regards.





Show quoteHide quote
"TyBreaker" <tybreakerNO@SPAMhotmail.com> escribió en el mensaje news:%23fPh0P3UGHA.5468@TK2MSFTNGP14.phx.gbl...
| Hi, I'm iterating through the folders on my system and am getting an
| exception with "System Volume Information".  Obviously it's a region I'm
| not supposed to access so I'm trying to filter it out by checking for
| the folder name before trying to use it:
|
| If Folder.Name <> "System Volume Information" Then
|   GetFolderDetails(Folder)
| End If
|
| But for some reason the if statement is not matching and I'm getting a
| run time exception within my GetFolderDetails because it is trying to
| access the files in that folder.  Can anyone explain why it doesn't get
| caught by my if?
| --
|  ______     ___               __
| /_  __/_ __/ _ )_______ ___ _/ /_____ ____
|  / / / // / _  / __/ -_) _ `/  '_/ -_) __/
| /_/  \_, /____/_/  \__/\_,_/_/\_\\__/_/
|     /___/
|
| There are 10 types of people in this world; those who understand the
| binary numbering system and those who don't.
|
| There's no place like 127.0.0.1.
|
| ASCII a silly question, get a silly ANSI.