How To: Run a chkdsk (Check Disk) Without Saying Y to Prompt

If you are using remote command line utilities to schedule a checkdisk on a machine for the next time it restarts, you will find that simply running the normal command chkdsk x: /f /r requires you to specify y to complete the command, however in some cases you cannot enter the y command to kick it off.

To complete this action, we can pre-build the command to automatically fill this in for you.

echo y|chkdsk x: /f /r /x where x: is the drive letter of the volume that needs to be scanned.