General discussion

  • Creator
    Topic
  • #2276321

    Automating Chkdsk

    Locked

    by edlockett ·

    I want my workstations to check for and repir errors on their local c: drive during the evening.
    There is a TechRepublic download for automating chkdsk and defrag. I downloaded this, but there is a bug in it. The code contains the line
    echo Y chkdsk /f /r
    Of course the result of this command is that “Y chkdsk /f /r” is echoed to the screen. This is not the desired result. What we want to do is tell chkdsk to run in fix mode upon the next reboot. There does not seem to be any way of telling chkdsk to do this without manually having to press the Y key. How is one supposed to schedule a disk check that will fix errors that it finds? Surely there must be a way!
    Thank you in advance for your advice.

All Comments

  • Author
    Replies
    • #3313395

      Reply To: Automating Chkdsk

      by rindi1 ·

      In reply to Automating Chkdsk

      Create an empty file with the name Y in the same directory where your chkdsk.exe is.

      Replace the code with the following:

      chkdsk /f /r

    • #3313370

      Reply To: Automating Chkdsk

      by sgt_shultz ·

      In reply to Automating Chkdsk

      i believe you are simply missing the ‘pipe’ character between the Y and chkdsk. i will type it here but in case it won’t html, it is the shift backslash key (above the enter key)
      echo Y|chkdsk. yes, it looks like a vertical line typed here.read it this way: ‘echo Y and pipe it to the chkdsk command’ i believe the explanation is pipe takes the console output and redirects it to whereever you say. hopefully it works that way in xp also

    • #3313363

      Reply To: Automating Chkdsk

      by edlockett ·

      In reply to Automating Chkdsk

      This question was closed by the author

    • #2839473

      Autonatubg chkdsk

      by ekson73 ·

      In reply to Automating Chkdsk

      The correct command can be find at
      http://support.microsoft.com/kb/197527

      echo y|chkdsk [target drive, i.e. D:] /f/r

Viewing 3 reply threads