CHKDSK is used to check the status of a disk, fix some disk errors, and display a status report showing any errors found in the file allocation table (FAT) and directory structure. CHKDSK also displays a summary of disk usage. If errors are found on the disk, CHKDSK displays a warning message.
CHKDSK [path] [/F] [/V]
Path Specifies the drive and directory to check.
/F Fixes errors on the disk.
/V Displays the full path and name of every file on the disk
SCANDISK can reliably detect and fix a much wider range of disk problems and is generally preferred to the somewhat dated CHKDSK. The /F switch (for fixing any errors found) should not be used while any program is running other than DOS and CHKDSK itself.
CHKDSK cannot be used on drives created using SUBST, nor can it be used on network drives. In win98, CHKDSK does not check the disk, though still provides some basic data
You should not scan the disk with CHKDSK or SCANDISK or any other disk scanning program if your disk is crashed or there is any logical error in your boot sectors like MBR, DBR, FAT or root directories are corrupted. It may make you data information distorted and can make it difficult to recover. Not only this you may not recover data completely.
Clears the screen leaving only the command prompt and cursor.
Starts a new copy of the Command Interpreter.
COMMAND [path] [device] [/Switches]
Path Drive and directory containing command.com. This must be specified unless command.com is in the root directory.
Device Device to use for command input and output. By default this is the keyboard and monitor
/P Makes the new Command Interpreter permanent.
/E:x Sets the initial environment size [bytes]. x should be set between 256 and 32,768 bytes. The default is: 256 bytes.
/L:y Internal buffers length [bytes]. y should be set between 128 and 1,024 bytes. This switch is only accepted if the Command Interpreter is permanent. The /P switch must also be set.
/U:z Input buffer length [bytes]. z should be set between 128 and 255 bytes. The default is: ? This switch is only accepted if the Command Interpreter is permanent. the /P switch must also be set.
/MSG Stores all error messages in memory. This switch is only accepted if the Command Interpreter is permanent. The /P switch must also be set.
/LOW Forces COMMAND to keep in low memory
/Y Steps through the batch program specified by /C or /K
/C command Executes command and exits. This must be the last switch on the command line.
/K command Executes command and continues running. This must be the last switch on the command line.
The prime use of COPY is to copy one or more files to another location but it can also be used to combine (append and concatenate) files and to type directly to a file, printer, or other device.
COPY [/A | /B] source [/A | /B] [+ source [/A | /B] [+ ...]]
[destination [/A | /B]] [/V] [/Y | /-Y]
source The file(s) to be copied. Although this must be a single parameter, it may include multiple files specified using wildcards (* or ?). It may also be a valid device (e.g. CON)
like COPY CON NOTES.TXT
now write or copy the text and come out by entering the key Ctrl+Z.
destination The directory and/or filename for the new file(s). If destination is not specified source is copied to the current directory with the same name and creation date as the original. If source is in the current directory, an error message is displayed stating that the "file cannot be copied to itself”.
file /A Forces COPY to treat the file as an ASCII text file.
file /B Forces COPY to treat the file as a binary file.
/V Verifies that new files can be read.
/Y No warning prompt before overwriting a file.
/-Y Displays a warning and requires confirmation before
overwriting a file.
When used from the command line, if a file specified in destination already exists in the specified location, COPY will, by default, display a warning message and require confirmation before overwriting the old file. On the other hand, when COPY is used in a batch file, any existing files will be overwritten without warning.
This default behavior can be modified by presetting the /Y | /-Y switch in the COPYCMD environment variable and overruled by using the /Y | /-Y switch on the command line.
COPY does not copy files that are 0 bytes long; instead, it deletes such files. Use XCOPY to copy these files. Source and/or Destination may be an appropriate device (such as CON, COMx or LPTx where x is 1,2,3 exc.) rather than a file.
Depending on context, Copy treats files as binaries or ASCII text files. By default:
- When copying files from one location to another (ASCII or not), COPY assumes binary mode,
- When concatenating files, COPY assumes ASCII mode,
- When source or destination is a device (other than a disk), copy assumes ASCII mode.
When operating in binary mode, COPY determines the file's starting location from the File Allocation Table and copies the number of bytes allocated to that file from that point.
When in ASCII mode, data is copied until an End-Of-File (ASCII character no. 26; Ctrl-Z) character is reached. This character is NOT copied, but COPY adds an EOF character before closing the new file.
This convoluted procedure enables COPY to concatenate files and to work with non-file input (like keyboard). On the few occasions that the default mode is inappropriate, it may be over-ridden by adding the /A or /B switch to source and/or destination files as required.
To copy "note.txt" in the current drive and directory to the directory "mynotes":
COPY note.txt c:\mynotes
COPY note.txt c:\mynotes\
In the first case, if the "mynotes" directory doesn't exist, "note.txt" is copied to a file named "mynotes" in the root directory of drive C. In the second case, an "Invalid Directory" error message will be displayed. To copy all the files in the "mynotes" directory to a directory named "mynotes backup" on drive D:
COPY c:\mynotes\*.* d:\mynotes backup\
To make a copy of "note.txt" in the current drive and directory and call it "program note.txt"
COPY note.txt "program note.txt"
|Sample Chapters from book DATA RECOVERY WITH AND WITHOUT PROGRAMMING by Author Tarun Tyagi
Publishers of the Book
Number of Pages
Price of the Book
BPB Publications, New Delhi, India
$69.00 (Including Shipping Charges, Cost of Book and Other expenses, Free Source Code CD included with the Book)