Common DOS commands and commands for handling files
1. Common DOS commands
Drive letter: Enter the specified drive letter.
Dir lists the files and folders in the current directory
MD Create Directory
RD Delete Directory Note: Rd cannot delete non-empty folders, and can only be used to delete folders.
CD into the specified directory
CD: Go back to the top level directory
CD \ Go back to the root directory
echo "Hello java" >a.txt writing text to the specified file
Type a.txt display file contents command
Del Delete file Note: You cannot delete a folder, only files can be deleted.
Exit launches DOS command line
CLS notifies the computer to empty the current command
* is a wildcard character.
tab command completion.
the arrow keys are up and down to retrieve the last command you wrote.
2. Commands for common batch files
Echo indicates the character that appears after this command
Tiltle sets the caption of the window.
echo off indicates that all running commands do not display the command line itself after this statement
Color sets the font color for the form.
@ with the echo off , but it is added at the front of each command line, indicating that the runtime does not display this line of command line (only affects the current row).
Pause running this sentence pauses the execution of the batch and displays it on the screen Press any key to continue ... prompt, waiting for the user to press any key to continue
REM The word identifier after this command is interpreted as a line (note), not executed, but for future reference (equivalent to comments in the program) or % the content of the comment %
%[1-9] represents a parameter, which is a space after the file name is added when the batch file is run (or Tab ) Delimited string
Common DOS commands and commands for handling files