By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,990 Members | 2,279 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,990 IT Pros & Developers. It's quick & easy.

System Volume Information

P: n/a
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.
Mar 29 '06 #1
Share this Question
Share on Google+
3 Replies


P: n/a
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.
"TyBreaker" <ty*********@SPAMhotmail.com> wrote in message
news:%2****************@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.

Mar 30 '06 #2

P: n/a
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.
Mar 30 '06 #3

P: n/a
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.

"TyBreaker" <ty*********@SPAMhotmail.com> escribió en el mensaje news:%2****************@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.
Mar 30 '06 #4

This discussion thread is closed

Replies have been disabled for this discussion.