System Volume Information

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • TyBreaker

    #1

    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
    GetFolderDetail s(Folder)
    End If

    But for some reason the if statement is not matching and I'm getting a
    run time exception within my GetFolderDetail s 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.
  • Stephany Young

    #2
    Re: System Volume Information

    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 GetFolderDetail s(Folder) call in a try catch and handle the
    exception.


    "TyBreaker" <tybreakerNO@SP AMhotmail.com> wrote in message
    news:%23fPh0P3U GHA.5468@TK2MSF TNGP14.phx.gbl. ..[color=blue]
    > 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
    > GetFolderDetail s(Folder)
    > End If
    >
    > But for some reason the if statement is not matching and I'm getting a run
    > time exception within my GetFolderDetail s 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.[/color]


    Comment

    • TyBreaker

      #3
      Re: System Volume Information

      Stephany Young wrote:[color=blue]
      > First of all, what is the value of Folder.Name when you hit the folder in
      > question?[/color]

      Well according to the break point I have in my GetFolderDetail s 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.
      [color=blue]
      > Wrap your GetFolderDetail s(Folder) call in a try catch and handle the
      > exception.[/color]

      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.

      Comment

      • José Manuel Agüero

        #4
        Re: System Volume Information

        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
        GetFolderDetail s(Folder)
        Catch ex As UnauthorizedAcc essException

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

        End Try



        Regards.





        "TyBreaker" <tybreakerNO@SP AMhotmail.com> escribió en el mensaje news:%23fPh0P3U GHA.5468@TK2MSF TNGP14.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
        | GetFolderDetail s(Folder)
        | End If
        |
        | But for some reason the if statement is not matching and I'm getting a
        | run time exception within my GetFolderDetail s 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.

        Comment

        Working...