Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 259
  • Last Modified:

how to skip over "system volume information"

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
GPrentice00
Asked:
GPrentice00
  • 4
  • 2
  • 2
1 Solution
 
DeAnCommented:
quick way, add this to top of sub that error happens.

On Error Resume Next
0
 
GPrentice00Author Commented:
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
 
DeAnCommented:
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!

 
GPrentice00Author Commented:
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
 
GPrentice00Author Commented:
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
 
GPrentice00Author Commented:
Will post request for closure
0
 
SpideyModCommented:
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
 
SpideyModCommented:
PAQ'd and all 65 points refunded.

SpideyMod
Community Support Moderator @Experts Exchange
0

Featured Post

Independent Software Vendors: 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!

  • 4
  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now