CHKDSK

RECENT NEWS

12/18/2015 - Hello! We're excited to announce that Mental Works Computing Software will soon be featuring

12/11/2015 - We're going to announce Dr.Batcher 3.0 Alpha with batch files debugger support soon. If you want to start...

News history...

TESTIMONIALS

Rob van der Woude:
"Mental Works Computing Software has created a nice tool for...

Andrew Jaritsyn:
“I used to write batch files with the help of Notepad, but...

Steve H.:
“This tool helped me to write some batch files in a couple...

More...

CHKDSK

Checks disk for consistency, repairs file system problems and displays the status report.

Syntax:

CHKDSK [Drive:[[Path]FileName]] [/f] [/v] [/r] [/x] [/i] [/c] [/l[:Size]] [/b]

Drive:– the drive to be checked.

Path and FileName – path and name of the file to be checked for fragmentation (FAT/FAT32 file systems only). Wildcards (*, ?) are allowed.

/f – fixes errors if they are found.

/v –verbose output: displays the full path and the name of each file on the disk being checked.

/r – locates bad sectors on disk and tries to recover information from them. Includes the functionality of /f.

/x – dismounts all volumes first (if necessary) closing all file handles. Available in Win2003 and above. Includes the functionality of /f.

/i – skips check that compares directory records to the file record segment in the master file table of volume (in other words, speeds up the disk check). NTFS only.

/c – skips the check of cycles in the directory structure (in other words, speeds up the disk check). NTFS only.

/l:Size – shows or limits the size of CHKDSK log file. Without Size specified, shows the current size of log file. Size should be specified in Kbytes. NTFS only.

/b – clears the list of bad clusters and re-scans all clusters for errors. Includes the functionality of /r. NTFS only.

Usage:

If you try to fix errors on the boot partition, CHKDSK will ask you to fix the errors on the next boot.

CHKDSK must be able to lock the drive to correct errors.

You should have at least local administrator permissions to execute CHKDSK.

Interrupting CHKDSK is not recommended because it can lead to different errors on the disk being checked.

Exit codes of the CHKDSK are the following:

0 – no errors found during the scanning process

1 – errors were found and fixed

2 – disk cleanup performed

3 – could not check the disk, errors found are not fixable of /f was not specified.

Examples:

Check drive without fixing the errors:

CHKDSK d:

Check NTFS drive in the fastest way:

CHKDSK e: /i /c

Check NTFS drive in the most verbose and slow way:

CHKDSK e: /v /b

 

Subscribe batch files programming newsletter (no spam):

Subscribe

Unsubscribe