473,394 Members | 1,740 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,394 software developers and data experts.

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

Jul 21 '05 #1
3 1564
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" <an*******@discussions.microsoft.com> wrote in message
news:45****************************@phx.gbl...
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

Jul 21 '05 #2
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.
-----Original Message-----
Are you wrapping the code that's accessing the files/directories in a trycatch? If not, I belive you can just eat the exception and processing willcontinue as normal.
"Pete" <an*******@discussions.microsoft.com> wrote in messagenews:45****************************@phx.gbl...
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

.

Jul 21 '05 #3
Hi,

It may require a call to the Win32 API SetErrorMode perhaps?
Cheers
-jr-
Jul 21 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Martin | last post by:
Hi, I have implemeted a recursive function that basically iterate throught the entire file system and prints out the entire path of each directory that it come across. The only problem is the...
3
by: Pete | last post by:
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...
1
by: Aek | last post by:
What is the best way to recursively change the permissions of the directory we are installing into? Is there a nice way to do this in C# ..NET? We are using an MSI installer and will need to add...
1
by: Rinaldo | last post by:
Hi, I have a problem to get the directory. I've tryed: public void WriteWeb(DirectoryInfo directory) {
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

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.