Coding With Fun
Home Docker Django Node.js Articles Python pip guide FAQ Policy

The DOS command set


May 23, 2021 DOS Command learning manual



DIR [drive:][path][filename] [/A[[:]attributes]] [/B] [/C] [/D] [/L]

[/O[[:]sortorder]] [ /P] [ /Q] [ /S] [ /T[[:]timefield]] [ /W] [ /X] [/4


[drive:] [ path] [filename]

Specify the drives, directories, and/or files to list.


/A displays files with specified properties.

Attributes D Directory R read-only files

H Hide files A files that are ready to be archived

S system file - a prefix that says "No."

/B uses an empty format (no title information or summary).

/C displays a thousand-digit separator in the file size. T his is the default. Use /-C

Deactivte the separator display.

/D is the same as wide, but the files are listed by column.

/L in small case.

/N New long list format with Chinese name on the far right.

/O lists the files in classification order.

Sortorder N by name (alphabetical) S by size (small to large)

E By extension (alphabetical) D by date/time (first to last)

Group G directory first - the prefix for the reverse order

/P Pause after each information screen.

/Q shows the file owner.

/S displays the files in the specified directory and all subdirectdirectles.

/T controls the time character field that is displayed or used to classify.

Timefield C was created

A Last visited

W Last written

/W in a wide list format.

/X appears as a short name that is not generated by the 8dot3 file name. The format is /N,

The short name is inserted in front of the long name. If there is no short name, it is in its location

Blank is displayed.

/4 shows the year in four digits


Switches can be pre-set in the DIRCMD environment variable. By adding a prefix - (Dash)

to replace the pre-set switch. For example, /-W.


Cd

Show the current directory name or change the current directory.


CHDIR [/D] [drive:][path]

CHDIR [..]

CD [/D] [drive:][path]

CD [..]


.. Specify that you want to change to the parent directory.


Type CD Drive: Displays the current directory in the specified drive.

Type only the CD without parameters, showing the current drive and directory.


Using the /D command line switch, in addition to changing the current directory of the drive,

You can also change the current drive.


If the extension command name is enabled, CHDIR changes as follows:


The current directory string is converted to use case on the disk name. So

If this is the case on the disk, CD C: s TEMP sets the current directory to

C:\Temp。


The CHDIR command does not treat spaces as separators, so it is possible to change the directory name to one

Subdirectt names with spaces but no quotation marks. For example:


cd \winnt\profiles\username\programs\start menu


Same as the following:


cd "\winnt\profiles\username\programs\start menu"


In the event that the extended functionality is disabled, you must type the above commands.


Create a directory.


MKDIR [drive:]path

MD [drive:]path


If the command extension is enabled, MKDIR changes as follows:


If required, MKDIR creates an intermediate directory in the path. For example: Let's say no

Exists, then:


mkdir \a\b\c\d


And:


mkdir \a

chdir \a

mkdir b

chdir b

mkdir c

chdir c

mkdir d


Same. If the extension is deactived, you'll need to type mkdir.


Delete a directory.


RMDIR [/S] [/Q] [drive:]path

RD [/S] [/Q] [drive:]path


/S, in addition to the directory itself, deletes all subdirectts and directories in the specified directory

File. Used to delete the tree.


/Q Quiet mode, no confirmation is required when deleting the tree with /S



Copy one or more files to another location.


COPY [/D] [/V] [/N] [/Y | /-Y] [/Z] [/A | /B ] source [/

[+ source [/A | /B] [+ ...]] [destination [/A | /B]


Source specifies the file to copy.

/A represents an ASCII text file.

/B represents a binary file.

/D allows you to decrypt the target file you want to create

Destination specifies the directory and/or file name for the new file.

/V verifies that the new file was written correctly.

/N When copying a file with a non-8dot3 name,

Use short file names as much as possible.

/Y does not use to confirm that the existing target file is to be overwrote

tips.

/-Y use to confirm whether you want to overwrite an existing target file

tips.

/Z copies networked files in restartable mode.


The command line switch /Y can be pre-set in the COPYCMD environment variable.

This may be replaced by /-Y on the command line. Unless COPY

The command is executed in a batch file script, and the default value should be

Prompt when you override.


To attach a file, specify a file for the target and a file for the source

Several files (in wildcard or file1-file2-file3 format).


Show or change file properties.


ATTRIB [+R | -R] [+A | -A ] [+S | -S] [+H | -H] [[drive:] [path] filename] [/S [

/D]]


Set the property.

- Clear the property.

R read-only file properties.

A Archive file properties.

S system file properties.

H Hide file properties.

[drive:] [ path] [filename]

Specify the file properties to process.

/S handles matching files in the current folder and its sub-folders.

/D also handles folders.



The folder structure of the drive or path is graphically displayed.


TREE [drive:][path] [/F] [/A]


/F displays the name of Chinese of each folder.

/A uses ASCII characters instead of extended characters.




I know some commands


ASSOC displays or modifies file extension associations.

AT programs and programs that are scheduled to run on the computer.

ATTRIB displays or changes file properties.

BREAK sets or clears the extended CTRL-C check.

CACLS displays or modifies the file's Access Control List (ACLs).

CALL calls this one from another batch.

The CD displays the name of the current directory or changes it.

CHCP displays or sets the number of active code pages.

CHDIR displays the name of the current directory or changes it.

CHKDSK checks the disk and displays a status report.

CHKNTFS displays or modifies the boot time disk check.

The CLS clears the screen.

CMD opens another Windows command interpreter window.

COLOR sets the default console foreground and background color.

COMP compares the contents of two or two sets of files.

COMPACT displays or changes the compression of files on the NTFS partition.

CONVERT converts the FAT volume to NTFS. You cannot convert

The current drive.

COPY copies at least one file to another location.

DATE displays or sets the date.

DEL deletes at least one file.

DiR displays files and subdirectles in a directory.

DISKCOMP compares the contents of the two floppy disks.

DISKCOPY copies the contents of one floppy disk to another.

DOSKEY edits the command line, calls Windows commands, and creates macros.

ECHO displays a message, or turns command echo on or off.

ENDLOCAL ends localization of environment changes in the batch file.

ERASE deletes at least one file.

EXIT exits the CMD .EXE program (command interpreter).

FC compares two or two sets of files and displays them

Different places.

FIND searches for text strings in the file.

FINDSTR searches the file for strings.

FOR runs a specified command for each file in a set of files.

FORMAT formats the disk for use with Windows.

FTYPE displays or modifies the file types associated with the file extension.

GOTO points the Windows command interpreter to the batch

A marked line in .

GRAFTABL enables Windows to display in image mode

Extend the character set.

HELP provides help with Windows commands.

IF performs conditional processing in the batch program.

LABEL creates, changes, or deletes the volume label for the disk.

MD creates a directory.

MKDIR creates a directory.

MODE configuration system devices.

MORE displays a result screen at a time.

MOVE moves files from one directory to another.

PATH displays or sets the search path for executable files.

PAUSE pauses the processing of batch files and displays a message.

POPD restores the previous value of the current directory saved by PUSHD.

PRINT prints a text file.

PROMPT changes the Windows command prompt.

PUSHD saves the current directory and then changes it.

The RD deletes the directory.

RECOVER recovers readable information from the disk in question.

REM records batch files or CONFIG. Comments in SYS.

Ren renames the file.

RENAME renames the file.

REPLACE replaces the file.

RMDIR deletes the directory.

SET displays, sets, or deletes Windows environment variables.

SETLOCAL begins localization of environment changes in the batch file.

Shift replaces the location of the replaceable parameters in the batch file.

SORT categorizes inputs.

START starts another window to run the specified program or command.

SUBST associates a path with a drive call.

TIME displays or sets system time.

TITLE sets the window .EXE the CMD session.

TREE displays the directory structure of the drive or path in graphical mode.

TYPE displays the contents of the text file.

VER shows the version of Windows.

VERIFY tells Windows if the file is correct

Write to disk.

The VOL displays the disk label and serial number.

XCOPY copies files and tree.



ASSOC Displays or Modifies File Extension Associations Details of ASSOC .ext .


.ext specifies the file extension associated with the file type

FileType specifies the type of file associated with the file extension


Type ASSOC without parameters to display the current file association. If you only use file extensions

When the name calls ASSOC, the current file association for that file extension is displayed. If not

The file type specifies any parameters, and the command removes the association of the file extension.



AT commands are scheduled to run commands and programs on a specific date and time.

To use the AT command, the scheduled service must already be running.


AT [\\computername] [ [id] [/DELETE] | /DELETE [/YES]]

AT [\\computername] time [/INTERACTIVE]

[ /EVERY:date[,...] | /NEXT:date[,...]] "command"


The computername specifies the remote computer. If this argument is omitted,

Commands are scheduled to run on the local computer.

id specifies the identification number of the scheduled command.

/delete deletes a scheduled command. If the id is omitted,

All scheduled commands on the computer are deleted.

/yes does not require further confirmation when all jobs are deleted

the command to use together.

Time specifies when the command is run.

/interactive allows the job to run at runtime, with the user who logged on at the time

The desktop interacts.

/every: date,...) runs every month or every week on a specified date

Make. If the date is omitted, the default is in the month

Run this day.

/next:date,...) specifies the next specified date (e.g., next Thursday).

line command. If the date is omitted, the default is in each

This day of the month runs.

"command" is ready to run windows NT commands or batches

Program.



break

Set up or clear the extended CTRL-C detection of the DOS system


This command is reserved for compatibility with DOS systems in Windows XP

it doesn't work.


If the command extension is enabled and the operating platform is Windows XP,

The BREAK command enters a hard code break point when debugged by the debugger.



cacls

Access Control Table (ACL) that displays or modifies files


CACLS filename [/T] [/E] [/C] [/G user:perm] [/R user [...]]

[/P user:perm [...]] [/D user [...]]

Filename displays the ACL.

/T changes the current directory and all its subdirectdirectles

The ACL of the specified file.

/E Edit the ACL without replacing it.

/C Continues in the event of an access denied error.

/G user:perm gives the specified user access.

Perm can be: R read

W writes

C Change (Write)

F Full control

/R user revokes access to the specified user (legal only when used with /E).

/P user:perm replaces the specified user's access rights.

Perm can be: N None

R read

W writes

C Change (Write)

F Full control

/D user denied access to the specified user.

You can use wildcards to specify multiple files in a command.

You can also specify more than one user in the command.


Abbreviation:

CI - Container inheritance.

ACE is inherited by the directory.

OI - Object inheritance.

ACE is inherited by the file.

IO - Inherited only.

ACE does not apply to the current file/directory.