Welcome Guest ( Log In | Click here to Register a free account now! )
Welcome to Bleeping Computer, a free community where people like yourself come together to discuss and learn how to use their computers. Using the site is easy and fun. As a guest, you can browse and view the various discussions in the forums, but can not create a new topic or reply to an existing one unless you are logged in. Other benefits of registering an account are subscribing to topics and forums, creating a blog, and having no ads shown anywhere on the site.
Jun 30 2009, 02:25 AM
Post
#1
|
|
![]() Forum Regular ![]() ![]() ![]() Group: HJT Junior Classmen Posts: 190 Joined: 18-May 09 From: California Member No.: 332,966 |
Lately I have been running CHKDSK /f multiple times to fix issues. At one point I ran it probably 5 to 8 times (this is still quicker than re-install of win) I think I have a batch file that can do it but it doesnt work as I want it to. I would like to 1> Run CHKDSK if /F is required then run it on next boot 2> Run CHKDSK /f a specific number of times lets say 5 3> Continue the loop. 4> Or a combination of running 5 times but until there are no errors. I can add the script below to the start menu and it will work fine. However, I would like it to run only if CHKDSK says to run it with /F perhaps using the CHKDSK error codes below and only stop when no more errors are found or run CHKDSK /F when CHDSK says it cant continue due to errors. I can't fine which exit code would be /F and I looked in the event logs but it does not state. I guess I would just say run unless error 0 but I don't know who to integrate the codes with my batch file. 0 Success, no errors found. 1 Success, CHKDSK has detected and fixed major errors. 2 Success, CHKDSK has detected and fixed minor inconsistencies. 3 Error, CHKDSK could not complete. @echo off chkdsk.exe c: if ERRORLEVEL 2 goto ADD_CHECK echo. echo The drive is okay this time. goto end :ADD_CHECK reg ADD "HKLM\SYSTEM\CurrentControlSet\Control\Session Manager" /v BootExecute /t REG_MULTI_SZ /d "autocheck autochk /p \??\C:\0autocheck autochk *" /f echo. echo The drive has problems and chkdsk will run next boot shutdown -r -f -t -10 :end I am sure this can come in handy to other techs. I just don't have the time to sit looking at the screen. Eventually I will tie this in with defrag after chkdsk fixes all errors. Thank you -------------------- Member of the Bleeping Computer A.I.I. early response team!
|
|
|
|
![]() |
Jun 30 2009, 08:32 AM
Post
#2
|
|
![]() Look buddy -- I'm an Engineer ![]() ![]() ![]() ![]() ![]() ![]() Group: HJT Team Coach Posts: 8,510 Joined: 17-January 08 From: Northfield, Ohio Member No.: 184,215 |
If you have to run chkdsk 5 times, then your hard disk is failing and the drive should be replaced. I hope you have backups....
Billy3 -------------------- The forum is always a busy place. In the event I fail to reply within twenty-four hours, feel free to send me a PM.
Have I helped you? If so, please consider a donation (by clicking this link). And that means I solve problems. Not problems like "What is beauty?" .. 'cause that would fall under the purview of your conundrums of philosophy.... |
|
|
|
Jul 1 2009, 12:51 AM
Post
#3
|
|
![]() Forum Regular ![]() ![]() ![]() Group: HJT Junior Classmen Posts: 190 Joined: 18-May 09 From: California Member No.: 332,966 |
I thought about the HD being bad but I also have to take into account that these PC's are on literally weeks without being rebooted let alone turned off. I know that since the HD is (aside from the fans) the only components that is always moving they probably are near their expiration.
I rather do CHKDSK then wait weeks for get an HD purchased approved and purchased. The only good thing the company has is the "My Documents" folder re-directed to the server or have a group policy preventing any documents from being saved on the PC. I can't say they are cheap, actually wait, yes I can't say that they are freaking cheap while make tons of cash -------------------- Member of the Bleeping Computer A.I.I. early response team!
|
|
|
|
![]() ![]() |
| Lo-Fi Version | Time is now: 21st November 2009 - 08:19 PM |