Chkdsk process is failing when called from code
trying execute following snippet of code when additional disk attached system.
***************************************************************************
m_driveletter = driveletter.trim(path.directoryseparatorchar);
proc.startinfo.filename = chkdskprocessname;
proc.startinfo.arguments = string.format("{0} /x", m_driveletter);
proc.startinfo.windowstyle = processwindowstyle.hidden;
proc.enableraisingevents = true;
proc.exited += neweventhandler(chkdskproc_exited);
proc.start();
***************************************************************************
7 out of 10 times chkdsk process returns error code = 3, means
"could not check disk, errors not fixed, or errors not fixed because /f or /x not specified."
not sure why error occurring. can me how can troubleshoot this? there other alternate process may leverage with/without chkdsk? please suggest.thanks.
kausik kayal
perhaps device not ready when you're trying execute chkdsk.
is same disk has error? , happen if pull out , put in?
if happens same disks lean towards being hardware issue. if happens intermittentely , doesn't happen 2nd time same usb disk towards perhaps device not being ready. maybe need add 5 or 10 second delay time event triggered.
Visual Studio Languages , .NET Framework > Visual C#
Comments
Post a Comment