Sign in to follow this  
Followers 0
RedneckTech

Error With Chkdsk

5 posts in this topic

#1 ·  Posted (edited)

So I'm working on a general maintenance script. Part of it is to run chkdsk (just check no /f /r) and report that to a file. So far whenever i run the script, everything works perfectly, but i get errors on the chkdsk readout file, but then if i follow up with running chkdsk manually i get no errors. even piping results to a file.

so far has happened on a Dell XPS and Dell Precision both using the original factory image (Win 7), and a Dell Vostro 200 (Win XP)that has been reformatted like a week ago.

The error is always with the volume bitmap.

Here's the script im running:

If ProcessExists ("chkdsk.exe") <> 0 Then
   $pretime = TimerInit()
   While ProcessExists("chkdsk.exe") <> 0
      Sleep(1000)
      If TimerDiff($pretime) >= 1800000 Then
         FileWriteLine ( $DiskSick, _NowCalc() & "  Checkdisk was already running. Appears to be hung")
         $Defrag = 0
         ExitLoop
      EndIf
   WEnd
Else
   FileDelete (@WorkingDir & "Checklog.txt")
   Sleep(1000)
   $checklog = @WorkingDir & "Checklog.txt"
   $qchecklog = Chr(34) & $checklog & Chr(34)
   Run (@ComSpec & " /c chkdsk >> " & $qchecklog)
   $runinit = TimerInit()
   While ProcessExists("chkdsk.exe") <> 0
      Sleep(1000)
      If TimerDiff($runinit) >= 1800000 Then
         FileWriteLine ($DiskSick, _NowCalc() & "  Checkdisk appears to have hung")
         $Defrag = 0
         ExitLoop
      EndIf
   WEnd
   While ProcessExists("cmd.exe") <> 0
      Sleep(1000)
      If TimerDiff($runinit) >= 1800000 Then
         FileWriteLine ($DiskSick, _NowCalc() & "  Checkdisk appears to have hung")
         $Defrag = 0
         ExitLoop
      EndIf
   WEnd
EndIf

edit. Fixed the autoIT to show loops correctly

Edited by RedneckTech

Share this post


Link to post
Share on other sites



The type of the file system is NTFS.

The volume is in use by another process. Chkdsk

might report errors when no corruption is present.

Volume label is OS.

WARNING! F parameter not specified.

Running CHKDSK in read-only mode.

CHKDSK is verifying files (stage 1 of 3)...

0 percent complete. (0 of 179200 file records processed)

1 percent complete. (17920 of 179200 file records processed)

2 percent complete. (35840 of 179200 file records processed)

3 percent complete. (53760 of 179200 file records processed)

4 percent complete. (71680 of 179200 file records processed)

5 percent complete. (89600 of 179200 file records processed)

6 percent complete. (107520 of 179200 file records processed)

7 percent complete. (125440 of 179200 file records processed)

8 percent complete. (143360 of 179200 file records processed)

9 percent complete. (161280 of 179200 file records processed)

179200 file records processed.

File verification completed.

264 large file records processed.

0 bad file records processed.

0 EA records processed.

76 reparse records processed.

CHKDSK is verifying indexes (stage 2 of 3)...

11 percent complete. (3882 of 236600 index entries processed)

12 percent complete. (7876 of 236600 index entries processed)

13 percent complete. (11870 of 236600 index entries processed)

14 percent complete. (15865 of 236600 index entries processed)

15 percent complete. (19859 of 236600 index entries processed)

16 percent complete. (23854 of 236600 index entries processed)

17 percent complete. (27848 of 236600 index entries processed)

18 percent complete. (31842 of 236600 index entries processed)

19 percent complete. (35837 of 236600 index entries processed)

20 percent complete. (39831 of 236600 index entries processed)

21 percent complete. (43826 of 236600 index entries processed)

22 percent complete. (47820 of 236600 index entries processed)

23 percent complete. (51815 of 236600 index entries processed)

24 percent complete. (55809 of 236600 index entries processed)

25 percent complete. (59803 of 236600 index entries processed)

26 percent complete. (63798 of 236600 index entries processed)

27 percent complete. (67792 of 236600 index entries processed)

28 percent complete. (71787 of 236600 index entries processed)

29 percent complete. (75781 of 236600 index entries processed)

30 percent complete. (79775 of 236600 index entries processed)

31 percent complete. (83770 of 236600 index entries processed)

32 percent complete. (87764 of 236600 index entries processed)

33 percent complete. (91759 of 236600 index entries processed)

34 percent complete. (95753 of 236600 index entries processed)

35 percent complete. (99747 of 236600 index entries processed)

36 percent complete. (103742 of 236600 index entries processed)

37 percent complete. (107736 of 236600 index entries processed)

38 percent complete. (111731 of 236600 index entries processed)

39 percent complete. (115725 of 236600 index entries processed)

40 percent complete. (119719 of 236600 index entries processed)

41 percent complete. (123714 of 236600 index entries processed)

42 percent complete. (127708 of 236600 index entries processed)

43 percent complete. (131703 of 236600 index entries processed)

44 percent complete. (135697 of 236600 index entries processed)

45 percent complete. (139692 of 236600 index entries processed)

46 percent complete. (143686 of 236600 index entries processed)

47 percent complete. (147680 of 236600 index entries processed)

48 percent complete. (151675 of 236600 index entries processed)

49 percent complete. (155669 of 236600 index entries processed)

50 percent complete. (159664 of 236600 index entries processed)

51 percent complete. (163658 of 236600 index entries processed)

52 percent complete. (167652 of 236600 index entries processed)

53 percent complete. (171647 of 236600 index entries processed)

54 percent complete. (175641 of 236600 index entries processed)

55 percent complete. (179636 of 236600 index entries processed)

55 percent complete. (181274 of 236600 index entries processed)

55 percent complete. (181976 of 236600 index entries processed)

55 percent complete. (182489 of 236600 index entries processed)

55 percent complete. (182925 of 236600 index entries processed)

56 percent complete. (183630 of 236600 index entries processed)

56 percent complete. (185321 of 236600 index entries processed)

56 percent complete. (186312 of 236600 index entries processed)

56 percent complete. (187100 of 236600 index entries processed)

57 percent complete. (187624 of 236600 index entries processed)

57 percent complete. (188644 of 236600 index entries processed)

57 percent complete. (189153 of 236600 index entries processed)

57 percent complete. (190005 of 236600 index entries processed)

58 percent complete. (191619 of 236600 index entries processed)

58 percent complete. (193102 of 236600 index entries processed)

58 percent complete. (193353 of 236600 index entries processed)

58 percent complete. (194022 of 236600 index entries processed)

58 percent complete. (194494 of 236600 index entries processed)

58 percent complete. (195048 of 236600 index entries processed)

58 percent complete. (195465 of 236600 index entries processed)

59 percent complete. (195613 of 236600 index entries processed)

59 percent complete. (196137 of 236600 index entries processed)

59 percent complete. (196497 of 236600 index entries processed)

59 percent complete. (197205 of 236600 index entries processed)

59 percent complete. (197468 of 236600 index entries processed)

59 percent complete. (198370 of 236600 index entries processed)

59 percent complete. (198728 of 236600 index entries processed)

59 percent complete. (199372 of 236600 index entries processed)

60 percent complete. (199608 of 236600 index entries processed)

60 percent complete. (200323 of 236600 index entries processed)

60 percent complete. (200868 of 236600 index entries processed)

60 percent complete. (203360 of 236600 index entries processed)

61 percent complete. (203602 of 236600 index entries processed)

61 percent complete. (204983 of 236600 index entries processed)

61 percent complete. (205618 of 236600 index entries processed)

61 percent complete. (206375 of 236600 index entries processed)

61 percent complete. (206457 of 236600 index entries processed)

62 percent complete. (207597 of 236600 index entries processed)

236600 index entries processed.

Index verification completed.

0 unindexed files scanned.

0 unindexed files recovered.

CHKDSK is verifying security descriptors (stage 3 of 3)...

70 percent complete. (8854 of 179200 file SDs/SIDs processed)

71 percent complete. (20838 of 179200 file SDs/SIDs processed)

72 percent complete. (32821 of 179200 file SDs/SIDs processed)

73 percent complete. (44804 of 179200 file SDs/SIDs processed)

74 percent complete. (56787 of 179200 file SDs/SIDs processed)

75 percent complete. (68771 of 179200 file SDs/SIDs processed)

76 percent complete. (80754 of 179200 file SDs/SIDs processed)

77 percent complete. (92737 of 179200 file SDs/SIDs processed)

78 percent complete. (104720 of 179200 file SDs/SIDs processed)

79 percent complete. (116704 of 179200 file SDs/SIDs processed)

80 percent complete. (128687 of 179200 file SDs/SIDs processed)

81 percent complete. (140670 of 179200 file SDs/SIDs processed)

82 percent complete. (152653 of 179200 file SDs/SIDs processed)

83 percent complete. (164637 of 179200 file SDs/SIDs processed)

84 percent complete. (176620 of 179200 file SDs/SIDs processed)

179200 file SDs/SIDs processed.

Security descriptor verification completed.

28701 data files processed.

CHKDSK is verifying Usn Journal...

99 percent complete. (0 of 37510656 USN bytes processed)

100 percent complete. (37502976 of 37510656 USN bytes processed)

37510656 USN bytes processed.

Usn Journal verification completed.

The master file table's (MFT) BITMAP attribute is incorrect.

The Volume Bitmap is incorrect.

Windows found problems with the file system.

Run CHKDSK with the /F (fix) option to correct these.

467799063 KB total disk space.

108279092 KB in 118356 files.

72204 KB in 28702 indexes.

0 KB in bad sectors.

297495 KB in use by the system.

65536 KB occupied by the log file.

359150272 KB available on disk.

4096 bytes in each allocation unit.

116949765 total allocation units on disk.

89787568 allocation units available on disk.

have looked it over and cant seem to see anything causing the issue. have even gone so far as to "Run": cmd /c chkdsk >> C:Users__DesktopChecklog.txt

it still comes up no errors, but then follow with script and get errors. it has to be something with the way that the script is running checkdisk. if this particular error is nothing to be worried about i can just write some lines in to ignore it if it's the only error. Would still like to know why just for my own knowledge though

Share this post


Link to post
Share on other sites

Are you running this on your C: drive? Doesn't your log tell you that there will/might be errors reported even when there aren't any errors?

The volume is in use by another process. Chkdsk

might report errors when no corruption is present.


If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.
Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag Gude
How to ask questions the smart way!

I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from.

Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays.  -  ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script.  -  Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label.  -  _FileGetProperty - Retrieve the properties of a file  -  SciTE Toolbar - A toolbar demo for use with the SciTE editor  -  GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI.  -   Latin Square password generator

Share this post


Link to post
Share on other sites

right. i understand that. yes it's on the c drive. Which is why i have 2 questions.

1) is this caused by the way AutoIT is written? (only happens when i run the command from an autoit exe or script) and if so (just for curiosity) what is it that causes this?

2) is this particular error something that can be a severe problem or is it ok to write into the script that this error is ok?

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0

  • Similar Content

    • FrancescoDiMuro
      By FrancescoDiMuro
      Good morning AutoIt community!
      Today, I'm here to ask you if you know how to run an .exe from cmd.exe ( Command Prompt )...
      My intention is to read a .ini file where I store an information that has to be included in the shell, and run an .exe with that information...
      I'll give you an example
      Local $aFileCartellaAuditCopy = _FileListToArray($sPercorsoAuditCopy, "*.txt") If @error Then MsgBox($MB_ICONERROR, "Errore!", "Errore durante la lettura della lista dei file nella directory" & @CRLF & $sPercorsoAuditCopy & @CRLF & "Errore: " & @error) Return False Else Local $iPID = Run("cmd.exe" & ' /k "C:\Users\Portatile-60\Desktop\HmiCheckLogIntegrity.exe" "C:\Users\Portatile-60\Desktop\AuditTrailDosaggio0_20170327_151335_DOSAGGIO_PW_01.txt"') ; & " /k " & '"' & $sHmiCheckLogIntegrity & '"' & " " & '"' & $sPercorsoAuditCopy & "\" & $aFileCartellaAuditCopy[1] & '"', "", @SW_SHOW, $STDOUT_CHILD) Return True EndIf This code is in a function, that returns False if it can retrive at least a file from the path stored in the .ini file...
      Else
      I would like to run the Command Prompt with the .exe and with a parameter of that .exe, but it seems to not work properly.

      Could please anyone tell me why?

      Thanks  
    • Tumulus
      By Tumulus
      I need to create a new administrator account on a number of computers, so figured I would make a script to do it. 
      You can only add/modify admin profile from an elevated command prompt (administrator command prompt). So I tried writing that into my short script. I thought that my "RunAs" command below would do the trick, but it opens a standard cmd window through the admin profile.
      Anyone able to tell me how to get it to open the elevated cmd?
      RunAs("administrator",@ComputerName,$sAdminPassword,0,@ComSpec) Sleep (500) Send("net user /ADD " & $sUsername & " " & $sPassword) Send("{ENTER}") Send("Y") Send("{ENTER}") Send("net user " & $sUsername & " /passwordchg:no") Send("{ENTER}") Send("net localGroup administrators " & $sUsername & " /ADD") Send("{ENTER}") WinClose("C:\Windows\system32\cmd.exe")  
    • lrstndm
      By lrstndm
      Hi all,
      I am working on a application with a GUI and command prompt in 1.
      Currently my code looks this simple >
      #AutoIt3Wrapper_UseUpx=y #AutoIt3Wrapper_Change2CUI=y #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> $Form1 = GUICreate("Form1", 615, 437, 192, 124) GUISetState(@SW_SHOW) While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit EndSwitch WEnd But when I compile this and run the compiled version there is also a command prompt shown. But I don't want this.
      Besides that, I also want it to be possible when I run my script from the command prompt, the program will give feedback in the command prompt where it was started from. With the setup above. This is possible with the ConsoleWrite command. 
      Is it possible to hide the command prompt one way or another when I start the GUI? Or do I have to change my script?
      I hope someone can help me.
      Regards,
      lrstndm
    • ur
      By ur
      When I execute any batch command then it is prompting a command window for 1 second till the command executes with the below command.
       
      $CMD = "net localgroup administrators domainaname\usename /add"
      RunWait(@ComSpec & " /q /c " & $CMD)
       
      Is there any way to exeute the command without showing the window.
    • theak
      By theak
      Trying to make a script where it will run a command to show me the model name AND serial tag info on a laptop remotely and copy it to keyboard step by step. I know how to do this via WMIC but I'm curious how to create a CMD script out of it so I can just one click. So it would look something like....
      wmic csproduct get name *copy to clipboard* "Press enter to advance" [Enter] wmic csproduct get identifyingnumber *copy to clipboard* "Finished" Any ideas?