?
Solved

how to skip over "system volume information"

Posted on 2003-03-30
8
Medium Priority
?
249 Views
Last Modified: 2010-04-07
On my Win2000, VB6 machine:

Using the Filesystemobject in VB to recursively examine some folders, one of the folders that appears is the "system volume information".  Its properties are Read only, hidden, system, directory, archive.  A folder object can be set to this, but for recursive purposes, I access the folderobject.subfolders collection.  But the program crashes at this point, runtime error 70: permission denied.  Same type of error when trying to click on this folder in explorer...  I can see it in the explorer folded view, but cant get into it.

I don't really care about that folder anyways, so I want to skip over it at that point and continue with the other folders in the list, but I want a method specific to that special type of special folder.

I want to include other hidden, system folders in my examination, so using the file attributes to exclude it are out of the question.  I've gone batty looking at each fso and folder property to see if theres something unique for that folder, but don't see anything.

Will this folder ALWAYS be called "System volume information" and allow a folder name exclusion?  Will this folder always be in the C:\ path, or will one exist for each NTFS drive?  Is this something that originated in NT and carries through to XP, or is it unique to Win2000?  Is there an equivalent XP complicated folder?
Does win98 or win95 have any bizarre folders like this - I think not, as I'm sure I one used a similar recursive approach on a Win98 system, but now I'm beginning to doubt myself...
0
Comment
Question by:GPrentice00
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 2
  • 2
8 Comments
 
LVL 3

Expert Comment

by:DeAn
ID: 8234594
quick way, add this to top of sub that error happens.

On Error Resume Next
0
 
LVL 6

Author Comment

by:GPrentice00
ID: 8234623
On Error Resume Next

Yes, it does work, but much like using   As Any  in my API declarations, I would rather juggle flaming chainsaws.

0
 
LVL 3

Expert Comment

by:DeAn
ID: 8234763
not sure if this will help..

'Attribute 8 is: Disk drive volume label, read-only.

Dim fs, f
Dim FilePath As String
FilePath = "C:\Path\To\file.ext"
Set fs = CreateObject("Scripting.FileSystemObject")
Set f = fs.GetFile(fs.GetFileName(FilePath))
If f.Attributes <> 8 Then
    'do your thing...
End If
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 6

Author Comment

by:GPrentice00
ID: 8235160
the FSO system will allow you to set a folder object to the "system volume information" path, but as soon as you try to set a folder to the subfolder collection for it, or if you try to set access the filepath for "system volume information" files, it hits the error.  

Your code is the correct way to examine a single file of specified path, (actually it still likely to crash as it is: you should first check if it exists), but took the fork in the road long ago diverging it from the problem at hand..

But thanks for trying still!


0
 
LVL 6

Author Comment

by:GPrentice00
ID: 8250383
DeAn

I'm a bit torn.  Technically, your On Error  solution is a correct answer (one that I should have specified in my Q that I was not wanting to use, but I didnt), although not an answer I find satisfactory.

If you insist, I'll give you 20pts in a new question, and clear this.

The question as it stands is still open for answers - few questions are ever finalized, there's always a better way.
But for practical purposes, this issue is moot at this time now.

0
 
LVL 6

Author Comment

by:GPrentice00
ID: 8250388
Will post request for closure
0
 

Expert Comment

by:SpideyMod
ID: 8250714
A request for a refund has been made.  Experts you have 72 hours to object to the refund.

SpideyMod
Community Support Moderator @Experts Exchange
0
 

Accepted Solution

by:
SpideyMod earned 0 total points
ID: 8271416
PAQ'd and all 65 points refunded.

SpideyMod
Community Support Moderator @Experts Exchange
0

Featured Post

[Webinar] How Hackers Steal Your Credentials

Do You Know How Hackers Steal Your Credentials? Join us and Skyport Systems to learn how hackers steal your credentials and why Active Directory must be secure to stop them.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…
Suggested Courses
Course of the Month9 days, 21 hours left to enroll

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question