Discussion Locked

Automating Chkdsk

0 helpful
6 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

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.

6 replies

by rindi1

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

by sgt_shultz

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

This discussion is closed to new replies.