Vous êtes sur la page 1sur 7

MS-DOS COMMAND

Microsoft(R) Windows 98
(C)Copyright Microsoft Corp 1981-1999.
* (I) Internal Command, (E) External Command,(C ) Config sys file.
1.

C:\WINDOWS> ATTRIB/? (E)


Displays or changes file attributes.
ATTRIB [Option] [filename] [/S]
Options:
+
Sets an attribute.
Clears an attribute.
R
Read-only file attribute.
A
Archive file attribute.
S
System file attribute.
H
Hidden file attribute.
/S
Processes files in all directories in the specified path.
Example: To hide a file named riit.txt?
C :\> ATTRIB +H RIIT.TXT /S

2.

C:\WINDOWS> CD/? (I)


Displays the name of or changes the current directory.
CHDIR [drive:] [path]
CHDIR [..]
CD [drive:] [path]
CD [..]
.. Specifies that you want to change to the parent directory.
Type CD drive: to display the current directory in the specified drive.
Type CD without parameters to display the current drive and directory.

3.

C:\WINDOWS> CHKDSK/? (E)


Checks a disk and displays a status report.
CHKDSK [drive:][[path]filename] [/F] [/V]
[Drive:][Path]
Filename
/F
/V

Specifies the drive and directory to check.


Specifies the file(s) to check for fragmentation.
Fixes errors on the disk.
Displays the full path and name of every file on the disk.

Type CHKDSK without parameters to check the current disk.


Instead of using CHKDSK, try using SCANDISK. SCANDISK can reliably detect and fix a much
wider range of disk problems.
Example: To check the directory named riit.txt in C drive?
C:\>CHKDSK C:\ RIIT.TXT
4.

C:\WINDOWS> CLS/? (I)


Clears the screen.
CLS

5.

C:\WINDOWS> COMP/? (E)


Compares the contents of two files or sets of files.
COMP [data1] [data2] [/C] [Options]
data1
data2

Specifies location and name(s) of first file(s) to compare.


Specifies location and name(s) of second files to compare.

Options:
/D
/A
/L
/N=number
/C

Displays differences in decimal format.


Displays differences in ASCII characters.
Displays line numbers for differences.
Compares only the first specified number of lines in each file.
Disregards case of ASCII letters when comparing files.

To compare sets of files, use wildcards in data1 and data2 parameters.


6.

C:\WINDOWS> COPY/? (I)


Copies one or more files to another location.
COPY [source file name] [destination file name] [Options]
Options:
Source
/A
/B
Destination
/V
/Y
/-Y

Specifies the file or files to be copied.


Indicates an ASCII text file.
Indicates a binary file.
Specifies the directory and/or filename for the new file(s).
Verifies that new files are written correctly.
Suppresses prompting to confirm you want to overwrite an existing destination
file.
Causes prompting to confirm you want to overwrite an existing destination file.

The switch /Y may be preset in the COPYCMD environment variable.


This may be overridden with /-Y on the command line
To append files, specify a single file for destination, but multiple files for source (using wildcards
or file1+file2+file3 format).
7.

C:\WINDOWS> DATE/? (I)


Displays or sets the date.
DATE
Type DATE without parameters to display the current date setting and a prompt for a new one.
Press ENTER to keep the same date.

8.

C:\WINDOWS> DEL/? (I)


Deletes one or more files.
DEL [drive:] [path] filename [/P]
ERASE [drive:] [path] filename [/P]
[Drive:][Path] filename
/P

9.

-Specifies the file(s) to delete. Specify multiple files by using


wildcards.
- Prompts for confirmation before deleting each file.

C:\WINDOWS> DELTREE/? (E)


Deletes a directory and all the subdirectories and files in it.
To delete one or more files and directories:
DELTREE [/Y] [drive:] path [Directory name]
/Y

Suppresses prompting to confirm you want to delete the subdirectory.


2

[Drive:] path

Specifies the name of the directory you want to delete.

Note: Use DELTREE cautiously. Every file and subdirectory within the specified directory will be
deleted.
10. C:\WINDOWS> DIR/? (I)
Displays a list of files and subdirectories in a directory.
DIR [drive:] [path][filename] [Options]
[Drive:][Path][Filename] Specifies drive, directory, and/or files to list.
(Could be enhanced file specification or multiple filespecs.)
Options:
/P
Pauses after each screen full of information.
/W
Uses wide list format.
/A
Displays files with specified attributes.
attributes
D Directories
R Read-only files
H Hidden files
A Files ready for archiving
S System files
- Prefix meaning not
/O
List by files in sorted order.
Sort order
N By name (alphabetic)
S By size (smallest first)
E By extension (alphabetic)
D By date & time (earliest first)
G Group directories first
- Prefix to reverse order
A By Last Access Date (earliest first)
/S
Displays files in specified directory and all subdirectories.
/B
Uses bare format (no heading information or summary).
/L
Uses lowercase.
/V
Verbose mode.
/4
Displays year with 4 digits (ignored if /V also given).
Switches may be preset in the DIRCMD environment variable. Override preset switches by
prefixing any switch with - (hyphen)--for example, /-W.
11. C:\WINDOWS> DISKCOPY/? (E)
Copies the contents of one floppy disk to another.
DISKCOPY [drive1: [drive2:]] [Options]
Options:
/1
Copies only the first side of the disk.
/V
Verifies that the information is copied correctly.
/M
Force multi-pass copy using memory only.
The two floppy disks must be the same type. You may specify the same drive for drive1 and
drive2.
12. C:\WINDOWS> DISKCOMP/?
Compares the contents of two floppy disks
DISKCOMP [drive1: [drive2:]
13. C:\WINDOWS> DOSKEY/? (E)
Edits command lines, recalls command lines, and creates macros
DOSKEY [/switch] [macro name= [text]]
/HISTORY
/MACROS
Macro name
text

Displays all commands stored in memory


Displays all DOSKey macros
Specifies a name for a macro you create
Specifies commands you want to assign to the macro
3

UP, DOWN
Esc
F7
Alt+F7
[Chars]F8
F9
Alt+F10

arrows recall commands


clears current command
displays command history
clears command history
searches for command beginning with [chars]
selects a command by number
clears macro definitions

The following are special codes you can use in DOSKey macro definitions:
$T
Command separator: allows multiple commands in a macro
$1-$9 Batch parameters: equivalent to %1-%9 in batch programs
$*
Symbol replaced by everything following macro name on the command line
14. C:\WINDOWS> ECHO/? (I)
Displays messages, or turns command-echoing on or off.
ECHO [ON | OFF]
ECHO [message]
Type ECHO without parameters to display the current echo setting.
15. C:\WINDOWS> EDIT/? (E)
MS-DOS Editor Version 2.0.026 Copyright (c) Microsoft Corp 1995.
EDIT [File name]
16. C:\WINDOWS>EXIT/? (I)
Quits the COMMAND.COM program (command interpreter).
EXIT
17. C:\WINDOWS> FDISK/? (E)
Configures a hard disk for use with MS-DOS.
FDISK [Options]
Options:
/STATUS
/X

Displays partition information.


Ignores extended disk-access support. Use this switch if you receive disk access
or stack overflow messages.

18. C:\WINDOWS> FIND/? (E)


Searches for a text string in a file or files.
FIND [Options] "string" [[drive:][path]filename[ ...]]
Options:
/V
Displays all lines NOT containing the specified string.
/C
Displays only the count of lines containing the string.
/N
Displays line numbers with the displayed lines.
/I
ignore the case of characters when searching for the string.
"String"
Specifies the text string to find.
[Drive:][Path] filename specifies a file or files to search.
If a pathname is not specified, FIND searches the text typed at the prompt or piped from another
command.

19. C:\WINDOWS> FORMAT/? (E)


Formats a disk for use with MS-DOS.
FORMAT drive: [Options]
Options:
/V [: label]
/Q
/F: size
/B
/S
/T: tracks
/N: sectors
/1
/4
/8
/C

Specifies the volume label.


Performs a quick format.
Specifies the size of the floppy disk to format (such as 160, 180, 320, 360, 720,
1.2, 1.44, 2.88).
Allocates space on the formatted disk for system files.
Copies system files to the formatted disk.
Specifies the number of tracks per disk side.
Specifies the number of sectors per track.
Formats a single side of a floppy disk.
Formats a 5.25-inch 360K floppy disk in a high-density drive.
Formats eight sectors per track.
Tests clusters that are currently marked "bad."

20. C:\WINDOWS> LABEL/? (E)


Creates, changes, or deletes the volume label of a disk.
LABEL [drive:][label]
21. C:\WINDOWS> MD/? (I)
Creates a directory.
MKDIR [drive:] path
MD [drive:] path
22. C:\WINDOWS> MORE/? (E)
Displays output one screen at a time.
MORE [drive:][path]filename
MORE < [drive:][path]filename
Command-name | MORE [drive:][path][filename]
[Drive:][Path] filename Specifies file(s) to display one screen at a time
Command-name
Specifies a command whose output will be displayed.
23. C:\WINDOWS> MOVE/? (E)
Moves files and renames files and directories.
To move one or more files:
MOVE [/Y | /-Y] [drive:][path]filename1[,...] destination
To rename a directory:
MOVE [/Y | /-Y] [drive:][path]dirname1 dirname2
[Drive:][Path] filename1 Specifies the location and name of the file or files you want to move.
Destination
Specifies the new location of the file. Destination can consist of a drive
letter and colon, a directory name, or a combination. If you are moving
only one file, you can also include a filename if you want to rename the
file when you move it.
[Drive:][Path] dirname1 Specifies the directory you want to rename.
Dirname2
Specifies the new name of the directory.
/Y
/-Y

Suppresses prompting to confirm creation of a directory or overwriting


of the destination.
Causes prompting to confirm creation of a directory or overwriting of
the destination.
5

The switch /Y may be present in the COPYCMD environment variable.


This may be overridden with /-Y on the command line.
24. C:\WINDOWS> PATH/? (I)
Displays or sets a search path for executable files.
PATH [[drive:] path]
PATH;
Type PATH; to clear all search-path settings and direct Windows to search only in the current
directory.
Type PATH without parameters to display the current path.
25. C:\WINDOWS> PRINT/? (E)
Prints a text file.
PRINT [/D: device] [[drive:][path]filename[...]]
/D: device Specifies a print device.
26. C:\WINDOWS> PROMPT/? (I)
Changes the Windows command prompt.
PROMPT [text] or [options]
text

Specifies a new command prompt.

Prompt can be made up of normal characters and the following special codes:
$Q
$$
$T
$D
$P
$V
$N
$G
$L
$B
$H
$E
$_

= (equal sign)
$ (dollar sign)
Current time
Current date
Current drive and path
Windows version number
Current drive
> (greater-than sign)
< (less-than sign)
| (pipe)
Backspace (erases previous character)
Escape code (ASCII code 27)
Carriage return and linefeed

Type PROMPT without parameters to reset the prompt to the default setting.
27. C:\WINDOWS> RD/? (I)
Removes (deletes) a directory.
RMDIR [drive:]path
RD [drive:]path
28. C:\WINDOWS> REN/? (I)
Renames a file/directory or files/directories.
RENAME [Old filename] [New filename]
Note that you cannot specify a new drive or path for your destination.
29. C:\WINDOWS> REM/? (C)
Records comments (remarks) in a batch file or CONFIG.SYS.
REM [comment]
6

30. C:\WINDOWS> SORT/? (E)


Sorts input and writes results to the screen, a file, or another device
SORT [Options] [filename]
/R
Reverses the sort order; that is, sorts Z to A, then 9 to 0.
/+n
Sorts the file according to characters in column n.
[drive1:][path1] filename1
Specifies file(s) to be sorted
[drive2:][path2] filename2
Specifies a file where the sorted input is to be stored.
Command
Specifies a command whose output is to be sorted.
31. C:\WINDOWS> TIME/? (I)
Displays or sets the system time.
TIME
Type TIME with no parameters to display the current time setting and a prompt for a new one.
Press ENTER to keep the same time.
32. C:\WINDOWS> TYPE/? (I)
Displays the contents of text files.
TYPE [drive:][path]filename
33. C:\WINDOWS> VER/? (I)
Displays the Windows version.
VER
34. C:\WINDOWS> VOL/? (I)
Displays the disk volume label and serial number, if they exist.
VOL [drive:]
35. C:\WINDOWS> XCOPY/? (E)
Copies files and directory trees.
XCOPY [source] [destination] [Options]
Options:
Source
Destination
/A
/D: date
/P
/S
/E
/W
/C
/Q
/F
/L
/H
/R
/K
/Y
/-Y
/N

Specifies the file(s) to copy.


Specifies the location and/or name of new files.
Copies files with the archive attribute set, doesn't change the attribute.
Copies files changed on or after the specified date. If no date is given, copies
only those files whose source time is newer than the destination time.
Prompts you before creating each destination file.
Copies directories and subdirectories except empty ones.
Copies directories and subdirectories, including empty ones.
Prompts you to press a key before copying.
Continues copying even if errors occur.
Does not display file names while copying.
Displays full source and destination file names while copying.
Displays files that would be copied.
Copies hidden and system files also.
Overwrites read-only files.
Copies attributes. Normal Xcopy will reset read-only attributes.
Overwrites existing files without prompting.
Prompts you before overwriting existing files.
Copy using the generated short names.
7

Vous aimerez peut-être aussi