473,385 Members | 1,465 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

System Volume Information

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
3 1972
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
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: E G | last post by:
Hi! I am having problems in designing a class. First, I have a base class that allocates a 3D data set and allows some other mathematical operations with it, something like this: template...
1
by: Krazitchek | last post by:
Hi, i check all directories on a disk but an error occurs when i try to enter in the "System Volume Information" directory. Is there a way to "jump" this directory without to check the name of...
1
by: Jon1996 | last post by:
How do you access the volume label for a hard drive through C#? I am very much a beginner with C# at the moment and am developing a windows explorer program to help me learn. I have tried the...
0
by: geoffrey.slinker | last post by:
I have developed a new type of chart. It shows the relative volume for each price during an interval. http://home.att.net/~geoffrey.slinker/maverick/VolumeBars.html I am a Data Visualization...
7
by: Bill English | last post by:
How would I get the current system volume, from my application?
11
by: Tarren | last post by:
Hi: I need to get the unique GUID for a file, so I am using API calls through System.InteropServices I am using BY_HANDLE_FILE_INFORMATION and
6
by: Rob R. Ainscough | last post by:
I'm not sure why I'm getting this error when searching thru my local hard drives using My.Computer.FileSystem.GetFiles? I've got FileIOPermissions set in code: Dim f As New...
1
by: ramesh.nrk | last post by:
Hi, How can I retrieve Files/Folder from the "System Volume Information" folders from my system using C# code? thanks & regards. ramesh
17
by: ARC | last post by:
I've dealt with blue screens that frequently occur while developing in MS Access (really bad in Access 97, not quite as bad in later versions of Access). Finally, I had a blue screen that mentioned...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.