Use of Windows command line

Source: Internet
Author: User
Tags clear screen

Before we introduce the Windows Batch command, let's first describe the use of the Windows command line.


Windows Shell provides a black box interface, the command-line interface, about the role and benefits of the command line, I will not bother, the following only glimpse.

For convenience, lest the drive letter switch, I set up a folder in the F disk, the name is MyFile, the Windows Cmd.exe copy to MyFile folder, double-click Cmd.exe, you can do command line operation, double-click the result is:

Microsoft Windows XP [version 5.1.2600]
(C) Copyright 1985-2001 Microsoft Corp.

F:\myfile>


Let's look at the use of the command line (the results refer to the key results):

1. Dir (director): Listing directory

Enter Dir, and press Enter (later, in the narrative, omit this step)

The result is:

F:\myfile>dir
The volume in drive F is DISK1_VOL4
The serial number of the volume is E071-a2be

Directory of F:\myFile

2013-06-04 13:55 <DIR>.
2013-06-04 13:55 <DIR>.
2008-04-14 20:00 471,040 Cmd.exe
1 files 471,040 bytes
2 Directories 45,535,886,336 bytes available


2. MD (Make directory): Create a directory, that is, generate a folder

Input MD Video

Result: A video folder was created under the MyFile folder


3. CD (Current/change directory): current directory or change directory

(1) Enter the CD directly (or CD.) to display the current directory

(2) Input CD video, the current directory is the video directory

(3) Enter CD: Displays the previous level of the directory, which is the MyFile directory


4. RD (remove directory): Delete a directory, that is, delete a folder

Input: Rd Video

Result: The video folder was deleted


5. Echo: This command is used in a number of ways, the following is only a more important role

Input: Echo.>note.txt

Result: A note.txt file was created in MyFile

Of course, with copy con Note.txt can also produce the same effect, after entering, press CTRL + Z, and then press ENTER to generate the Note.txt file


6. Del (delete): Delete a file

Input: Del note.txt

Result: The Note.txt file was deleted


7. ren (rename): Re-command the folder or file as follows:

Microsoft Windows XP [version 5.1.2600]
(C) Copyright 1985-2001 Microsoft Corp.

F:\MYFILE>MD 1
F:\myfile>ren 1 2
F:\myfile>echo.>1.txt
F:\myfile>ren 1.txt 2.txt
F:\myfile>

So, in the folder MyFile folder 2 and file 2.txt


8. Copy: Copying (as to the specific copy of the file, or folder, it is not detailed, I can try to use when you can check the relevant documents, very easy)


9. Type: Output the contents of a text file (in a word, can you output the contents of the document?) Of course not! )

As follows:

Microsoft Windows XP [version 5.1.2600]
(C) Copyright 1985-2001 Microsoft Corp.

F:\myfile>echo. >1.txt, United States of America
F:\myfile>type 1.txt
United states
F:\myfile>


CLS (Clear screen): Clear


Windows Shell is really good, and here's a brief introduction to some of the commands:


Cmd:windows Shell, which has been introduced before, can show the version of Windows

Winver: View the Windows version number

Ver: View the version number of Windows (not quite the same as Winver)

Date: View and modify the system date

Time: Viewing and modifying system times

MEM: Show Memory usage

CLAC: Turn on the computer

Explorer: Open Resource Manager (not explore)

Regedit: Open the Resource registry

Debug:debug (This we are already familiar with, in the assembly language of the study often used)

FC: File Comparison

Pause: Output "Please press any key to continue ..."

Text Editor under Edit:dos

Text Editor under Notepad:windows

Command +/? : The use of the output command


Finally, it is worth mentioning that both Echo.>1.txt and Echo>1.txt are correct, but that the echo American >1.txt is wrong and must be used with echo. American >1.txt. So, it's better to take That "dot". Of course, you can also use a space to replace the "dot" behind Echo, and I think it's better.

Use of Windows command line

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.