5

I need to run chkdsk on my server but I don't want it to reboot and hang because it's waiting for some input. I don't have physical access to the server, I can only get to it through remote desktop. Is it possible to do the chkdsk unattended? I only need to do it once, not on a schedule.

Rush Frisby
  • 153
  • 1
  • 6

2 Answers2

5

Yes. From a command prompt run: chkdsk C: /F /R

This assumes that you want to run it on the C: drive and you want it to fix errors and relocate data from bad sectors. Since Windows will not be able to lock the C: drive it will prompt you regarding whether you want to run it at the next reboot or not, select Y for yes. This will require no user input when it runs.

joeqwerty
  • 108,377
  • 6
  • 80
  • 171
  • 4
    Two points to bear in mind when doing this (or any other disk maintenance). Be real sure your backup is good and allow extra time for the reboot. Also, if there really is a problem with the drive there's a chance the machine won't come back up. – John Gardeniers Oct 01 '10 at 02:40
  • @John: Once again, good points tacked on to one of my answers. Nice team work and thanks much. ;) – joeqwerty Oct 01 '10 at 10:54
0

If you want to run "chkdsk C: /F /R" unattended for example from a batch file, you need to echo Y for the answer "Would you like to schedule this volume to be checked the next time the system restarts?"

echo y | chkdsk C: /F /R
JPX
  • 151
  • 1
  • 2
  • 6