Corrupt Directory and DirectoryInfo

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

    Corrupt Directory and DirectoryInfo

    Sory if this is in the wrong group but wasn't exactly
    sure where to post.

    I am using the DirectoryInfo class in VB.NET 2003 to
    enumerate a filesystem and calculate different statistics
    on the file distribution and size, however if there is a
    directory or file that is corrupt a mesage box stating
    the "The file or directory is corrupt and unreadable
    please run chkdsk." The problem is this mesaage box
    halts the execution of my program until the ok button is
    clicked. Does anyone know how to supress this message.

    Thanks
    Pete

  • William Ryan

    #2
    Re: Corrupt Directory and DirectoryInfo

    Are you wrapping the code that's accessing the files/directories in a try
    catch? If not, I belive you can just eat the exception and processing will
    continue as normal.
    "Pete" <anonymous@disc ussions.microso ft.com> wrote in message
    news:45f901c3d2 f9$5c07a380$7d0 2280a@phx.gbl.. .[color=blue]
    > Sory if this is in the wrong group but wasn't exactly
    > sure where to post.
    >
    > I am using the DirectoryInfo class in VB.NET 2003 to
    > enumerate a filesystem and calculate different statistics
    > on the file distribution and size, however if there is a
    > directory or file that is corrupt a mesage box stating
    > the "The file or directory is corrupt and unreadable
    > please run chkdsk." The problem is this mesaage box
    > halts the execution of my program until the ok button is
    > clicked. Does anyone know how to supress this message.
    >
    > Thanks
    > Pete
    >[/color]


    Comment

    • Pete

      #3
      Re: Corrupt Directory and DirectoryInfo

      Yes the code is wraped in try/catch, and it isnot
      catching the error. It is not like your standard
      exception it is just generating that message box and
      blocking execution until ok is clicked, my code does not
      even have a call to msgbox in it any where.
      [color=blue]
      >-----Original Message-----
      >Are you wrapping the code that's accessing the[/color]
      files/directories in a try[color=blue]
      >catch? If not, I belive you can just eat the exception[/color]
      and processing will[color=blue]
      >continue as normal.
      >"Pete" <anonymous@disc ussions.microso ft.com> wrote in[/color]
      message[color=blue]
      >news:45f901c3d 2f9$5c07a380$7d 02280a@phx.gbl. ..[color=green]
      >> Sory if this is in the wrong group but wasn't exactly
      >> sure where to post.
      >>
      >> I am using the DirectoryInfo class in VB.NET 2003 to
      >> enumerate a filesystem and calculate different[/color][/color]
      statistics[color=blue][color=green]
      >> on the file distribution and size, however if there is[/color][/color]
      a[color=blue][color=green]
      >> directory or file that is corrupt a mesage box stating
      >> the "The file or directory is corrupt and unreadable
      >> please run chkdsk." The problem is this mesaage box
      >> halts the execution of my program until the ok button[/color][/color]
      is[color=blue][color=green]
      >> clicked. Does anyone know how to supress this message.
      >>
      >> Thanks
      >> Pete
      >>[/color]
      >
      >
      >.
      >[/color]

      Comment

      • John Reilly

        #4
        Re: Corrupt Directory and DirectoryInfo

        Hi,

        It may require a call to the Win32 API SetErrorMode perhaps?


        Cheers
        -jr-

        Comment

        Working...