Doscommand for beginners

Source: Internet
Author: User

Basic dos commands

CD changes the current directory sys to create a DOS system disk

Copy copy file del delete file

Deltree Delete directory tree dir column file name

Diskcopy disk edit text editing

Format create sub-directory for disk MD

Mem view memory status type display file content

Rd Delete directory rename change file name

Remember how much, forget to go to class to see, the following four commands are new, give the command format, try it yourself, learning computer is important to explore.

CLS clear screen

[Applicable] the screen is too messy or garbled. The content displayed on the screen is cleared without affecting any information in the computer.

[Usage] CLS carriage return

Move the file and change the directory name

[Applicable] Move files to other directories

[Usage] Move [file name] [Directory] Move the file to the new directory

Move [directory name] [directory name] Change the directory name

[Example] C :\> move c: \ autoexec. Bat c: \ old ??

Move the autoexec. BAT file to the old directory.

C: \> move c: \ config. sys c: \ old ??

Move the config. SYS file to the old directory.

More split-screen display

[Applicable] It is applicable to almost all commands, especially commands such as type, when the output is too large to display on screen. When more is used, the disk cannot have write protection or is not suitable for Optical drives.

[Usage] type [file name] | more split screen display file content

More <[file name] split-screen display of File Content

[Example] c: \> type msdos. w40 | more

Xcopy copy directories and files

[Applicable] It is useful when copying a large number of files together with subdirectories, which is much faster than the Copy command.

[Usage] xcopy [file name] [Directory]: copy the specified file to the specified directory

Xcopy [Source Directory] [destination Directory]: connect the source directory to the destination directory

Xcopy *. * [Directory]/s copy files and non-empty sub-directories to the specified directory

Other common parameters include v copy verification, which affects the speed.
E is similar to S, but it is copied even if the subdirectory is empty.
Help help

[Applicable] When you want to know how to use the doscommand

[Usage] Help provides help for all doscommands

Help [doscommand] provides help for commands

If you only remember a command, you can directly enter the HELP command at the prompt, and the following figure will appear:

Attrib sets file attributes

[Applicable] When you want to perform special processing on files

[Usage] attrib displays attributes of all files

Attrib + R or-R [file name] sets whether the file attribute is read-only

Attrib + H or-H [file name] sets whether the file attribute is hidden

Attrib + S or-s [file name] sets whether the file attribute is a system file

Attrib + A or-A [file name] sets whether the file attribute is an archive file

Attrib/s sets the attributes of files including subdirectories

[Example] c: \ test> attrib + R wina0000386

C: \> attrib + H *. */s ?? Hide all files

Date display and modification date

[Applicable scenarios] Want to know or modify the time and date

[Method] Date: Display and change the current date

[Example] c: \> date 09-20-1996 ?? Change the date to September 20, 1996

C: \> date ??

Current date is Tue 08-20-1996

Enter new date (Mm-dd-yy): 09-20-1996

Modify the current date in the order of month, day, and year. Press enter to ignore the modification date.

Lable

[Applicable] used to mark a disk

[Usage] label displays the disk volume label

Label [drive letter] [Volume name] sets the volume label of the specified Disk

[Example] c: \> label ??
Volume in drive C is Wang
Volume serial number is 2116-1dd0
Volume label (11 characters, enter for none )?
You can enter the volume label and press Enter.
Delete current volume label (y/n )?
Delete old volume labels by Y and N without changing

Defrag disk Fragment

[Applicable] the disk reads and writes many times, or the disk has been used for a long time. You may need to use this command to organize the disk. Disk fragmentation does not mean that the disk is broken, but because the disk usage is inconsistent after multiple copies and deletions, resulting in slow speed.

[Usage] 1. c: \> defrag ??

2. Select the disk to be sorted

3. Analyze the disk status on the computer and tell us how many disks need to be sorted out. Press ESC

4. Select the optimization method and select "all optimized" or "only file optimized"

5. Select begin optimization to start sorting.

6. After finishing the sorting, press the Enter key.

7. Press ESC to exit.
Doskey calls and creates dos macro commands

[Applicable] It is very useful when repeated commands are frequently required.

[Usage] doskey

Place the doskey in the memory and open the buffer. All input commands will be saved in the buffer and can be called at any time.

Doskey [macro command name] = [command name]

Define the macro command as a command. Then, enter the macro command, and the computer will execute the corresponding command.

Doskey/reinstall doskey

Doskey/bufsize = set the buffer size

Doskey/macros display all doskey macros

Doskey/History display all commands in memory

Doskey/Insert | overstrike: Specifies whether the new character overwrites the old one.

[Example] C :\> doskey ??
C: \> dir
C: \> copy c: \ temp \ *. *:
C: \> del c: \ temp \*.*
C: \> copy B: \ *. * c: \ Temp

The preceding four commands have been saved. You can use or modify the upper and lower commands with the cursor control key in sequence, or use the F7 key to list all the commands saved.

C: \> doskey di = DIR/W/P ?? Defines di as a macro command, which means to execute DIR/W/P

Fdisk hard disk partition

[Suggestion] partitioning is required only when the hard disk is infected by a virus that is of great interest or when a new hard disk is used. It is best to be knowledgeable. Hard disks can only be used after three steps: low-level formatting, partitioning, and formatting. Hard Disks in the finished computer have been processed.

[Usage] Enter fdisk and press enter to go to the prompt page.

Emm386 extended memory management

[Suggestion] This command is complicated. In chapter 5, the system configuration will be described in detail.

LH/loadhigh willProgramLoad high-end memory

[Applicable] This command is generally used in autoexec. bat. It is useful when some software requires a large amount of basic memory.

[Method] LH [Program]

When you load a program into high-end memory to use this command, the config. SYS file requires the following two statements. Device1_emm386.exe dos = umb

LH [Program]/L: add the program to the specified umb Zone

LH/s is generally dedicated to memmaker

[Example] c: \ mouse \> LH mouse ?? Load the mouse driver into high-end memory

Memmaker Memory Optimization Management

[Applicable] This command is rarely used now. When DOS is popular in the past, it is indispensable to play games. It can free up a lot of basic memory for the game to use. You only need to install it once.

[Usage] 1. c: \> memmaker ??

2. Press enter to continue and F3 to exit

3. Select manual installation and automatic installation. Press enter to indicate Automatic Installation (Press ENTER)

4. Select whether a program needs to expand the memory. The Space key can be selected. Yes indicates yes, no, no, and press Enter.

5. The program automatically checks whether Windows is installed in the hard disk.

6. If a floppy disk exists in the floppy disk, remove it and press the Enter key. The computer will be restarted twice. Do not interrupt it. Just press the Enter key.

(In fact, it's very easy. Just press the Enter key)

MSD system detection

[Applicable] used to check system information

[Usage method] 1. c: \> MSD press enter and the following screen is displayed. Annotations are added next to each option to indicate the function of the button.

?? 2. Select the project to be queried. For example, if you select the first computer, a dialog box will pop up showing some basic information about the computer. You can try other options to see what is useful.

3. press Alt + F to activate the drop-down menu and select "exit" to exit.

Undelete restore deleted files

[Applicable] It can be used when an error file is accidentally deleted.

When deleting a file, DOS only removes the file from the allocation table. In the disk storage area, the first letter of the file name is deleted. The file content is not immediately deleted from the disk, so it can be restored.

[Method] undelete restore deleted files

Undelete/All restore the file and do not ask whether to restore it,
Take "# % &-0123456789 abcdefghijklmnopqrstuvwxyz" as the first
Letter to Restore Files

Undelete/list column recoverable file name

Undelete/s allows undelete to reside in the memory, but almost no one uses it like this
Prompt setup prompt

[Applicable] when you get bored with the c: \> prompt or you want to make your prompt different, you can try a very interesting doscommand, the time and date can be displayed at any time.

[Usage] prompt $ p $ G uses the current directory name and> as the prompt, which is the most common prompt

Prompt $ t indicates the time prompt $ D indicates the date

Prompt $ prompt $ q =

Prompt $ V indicates the current version of prompt $ L <

Prompt $ B | prompt $ h indicates the return character.

Prompt $ e Represents the character prompt $ _ represents the line feed

[Example] c: \ dos> prompt Wang $ G ?? Use Wang> as a prompt

Wang> prompt $ T $ d $ G ?? Use the time, date, and> number as the prompt

0:01:07. 77thu 08-29-1996> prompt $ p $ G ??

C: \ dos>

Restore restore backed up Files

[Suggestion] If you have used backup for file backup before, you can use it to restore files when the original file is damaged.

Restore the files on the disk backed up by the BACKUP command to another disk. The backup disk should contain backup.00x and control.00x.

[Usage] restore [backup drive letter] [target drive letter]

Restore the backup file on the backup disk to the specified disk.

Restore/s restores all backup files, including subdirectories, to the specified disk.

Restore/P allows users to determine whether to restore files

Restore/B: files before date recovery

Restore/A: files after the date recovery date

Restore/L: files before the time recovery time

Restore/E: files after recovery time

Restore/m only restores files modified after the last backup

Restore/n only restores files deleted after the last backup

Restore/d only displays the file name to be restored

[Example] c: \ dos> restore a: C :??
Insert backup diskette 01 in drive:
Press any key to continue...

Put the first backup disk in drive a and press any key. After the first disk is restored, add it to another disk in order.

Use the following command to restore files:

C: \ dos> restore a: C: \/s ??
Time Display and modification time

[Applicable] is used to display and modify the time. The usage is the same as date.

[Example] c: \ dos> time ??
Current Time is 12:15:26. 04a
Enter New Time: 11:20:20. 00 p

Time: Enter the time in sequence, and then press enter in the afternoon (A/P) to ignore the modification time.

Set Environment Variables

[Applicable] used to set sound cards and paths

[Usage] Set [environment variable] = [String]

This command is often used in autoexec. bat.

[Example] c: \> set blaster = a220 I5 D1 set sound card Parameters

C: \> set Path = c: \ DOS path c: \ DOS has the same meaning

Smartdrv sets the disk accelerator

[Suggestion] It can improve the hard disk access speed. It is best to load it in the autoexec. BAT file.

[Usage] smartdrv/x

It is a common method to execute and reside in the memory, open the disk acceleration cache area, and shield all the drive caches (this command is usually enough)

Smartdrv/C writes information in the cache to the hard disk.

Smartdrv/E: Number to set the amount of information to be moved at a time

Smartdrv/B: Number to set the buffer size for pre-read
Append: Specifies the path of the non-executable file.

[Applicable] If you cannot find the document you entered in multiple directories, you can try this command, which is similar to path.

[Usage] append [path]; [path]

[Example] C :\> append c: \ test ??

Set the path to search for non-executable files to C: \ testif 1.txt is not found in the directory, the c: \ test directory can be found automatically.

D: \ UCDOS> edit 1.txt. You can find the c: \ test \ 1.txt file.

Debug program debugging command

[Suggestion] If you have learned the assembly language, you should use DEBUG. If you have never learned it, it is best not to use it.

[Usage] Debug [file name]

Diskcomp comparison Disk

[Applicable scenarios] If the two disks are the same, I didn't expect to use them at any time. Why don't I use diskcopy/V verification to compare the two diskcopy disks?

[Usage] diskcomp [drive letter 1] [drive letter 2] comparison Disk 1 and Disk 2

Diskcomp/1 only compares the first side of the Disk

Diskcomp/8 only compares the first eight sectors without a track

[Example] c: \> diskcomp:
Compare two disks in the same drive

Insert first diskette in drive:
Put the first disk

Press any key to continue...

Comparing 80 tracks 18 sectors per track, 2 side (s)
Insert Second diskette in drive:
Put the second disk

Press any key to continue... compare OK
Comparison not found different

Compare another diskette (y/n )? N
Compare other disks, select y to continue the comparison, and select n to stop
Expand decompression tool

[Applicable] Microsoft's original software installation disk contains many compressed files suffixed with "_". You can use it to decompress the files to relieve the trouble caused by the loss of a few files.

[Usage] expand [source file name] [target file]

[Example] C :\> expand a: vsafe. CO _ c: \ dos \ vsafe.com

? When? Vsafe. CO _ is the vsafe.com file.

Microsoft (r) File expansion utility version 2.10 copyright (c) Microsoft Corp 1990-1993. All rights reserved.

Expanding A: vsafe. CO _ to c: \ dos \ vsafe.com. A: vsafe. CO _: 33046 bytes expanded to 62576 bytes, 89% increase.

C: \ dos>

Fasthelp quick display of help information

[Suggestion] You can check all the commands. For a single command, it is better to add/after the command name /? Convenient Parameters

[Usage] fasthelp lists the usage of all DOS Commands

Fasthelp [command name] shows the usage of a command, which is equivalent to [command name]/?

FC file comparison

[Suggestion] It may never be used by most people.

[Method] FC [file name 1] [file name 2] different parameters of the two files are as follows: a C l LBN n t w NNNN

[Example] c: \ test> fc a. Bat B. bat ??
Comparing files a. BAT and B. bat
* ***** A. bat
Choice/C: dimethyl defrag, mem, end
If errorlevel 3 goto defrag
If errorlevel 2 goto mem
If errotlevel 1 goto end
* *** B. Bat choice/C: dimethyl ether defrag, mem, end
* *** C: \ test>
Interlnk

[Applicable] If there are two computers that can be connected with intersvr to form a simple network, this is a useful command, but it is not commonly used.

[Usage method] added the network support function in DOS,
It can enable the two computers to form a simple network using interlnk through a parallel or serial line. You must add a sentence in config. SYS:
Device = c: \ dos \ interlnk
The two ends of the joint should be 25-pin public joints, and the connections between the needles are as follows:
P2 ------------------------ p15
P3 ------------------------ P13
P4 ------------------------ p12
P5 ------------------------ P10 public joint refers to the joint with a needle
P6 -------------------------- P11 connector refers to the connector with a hole
P15 ----------------------- p2
P13 ----------------------- p3
P12 ----------------------- p4
P10 ----------------------- P5
P11 ----------------------- p6
P25 ----------------------- P25 Ground Wire

[Example] c: \ dos \> interlnk Port-LPT1

This computer other computer

(Client) (server)

----------------------------------------

E: equals:

F: equals C:

In the client, the E disk is the disk of the service machine, and the F disk is the c disk of the service machine.

Start simple server with intersvr

[Applicable] when using it, the computer becomes a server (only for the Simple Network provided by DOS)

[Method] intersvr starts the server

Intersvr/LPT: 1 starts the server and uses the LPT1 port as the data transmission port.

Intersvr/COM: 1 starts the service machine and uses the COM1 port as the data transmission port.

The parameter also has x Baud: B V rcopy (see interlnk)

[Example] c: \ dos> intersvr ??

QBASIC starts the basic Integration Environment

[Suggestion] It may never be used by most people.

[Usage] If qbasiC LanguageYou can use it to compile your own program. Edit.com must be available.

QBASIC starts the BASIC Language Environment

QBASIC/Editor language editing in full screen mode

The parameter is also B G H MBF nohi run.

[Example] c: \ dos> QBASIC ??
Setver version

[Applicable] It can be used to cheat computers when you want to use the doscommand of another version. In high-version dos, when some old-version programs require dos3.3, setver can be used to set

[Usage] deviceappssetver.exe is generally added to config. sys.

Setver display file version

Setver [file name] n. nn sets the version number of the specified file

[Example] c: \ dos> setver ??
Kernel. EXE 5.00
Dosoad. sys 5.00
Edlin. EXE 5.00
Backup. EXE 5.00
Assign. com 5.00
Exe2bin. EXE 5.00
Join. EXE 5.00
Recover. EXE 5.00
Winword. EXE 4.10
C: \>

If the program aaa.exe must be executed under the MS-DOS3.3, Type

C: \ dos> setver aaa.exe 3.30 ??

For example, if net5.exeis executed only under ms-dos5.0, you can also run it under the Ms-DOS6.22 after adding device1_setver.exe to config.sys.

Share file sharing

[Suggestion] It is used only when the software declaration must run it

[Usage] You can add install1_cmd.exe to config. sys or run the command with the f l parameter.

SUBST path replacement

[Suggestion] a very interesting command may be useful if CD software is often used.

[Usage] SUBST displays the current alternative path

SUBST [drive letter] [path]
Replace the specified path with the drive letter.

Remove replacement from SUBST/B

[Example] c: \ dos> SUBST a: C: \ Temp ?? Replace disk A with the temp directory of disk C

C: \> SUBST a:/D? When? Substitution

Tree display command tree structure

[Applicable] view all subdirectories

[Method] tree [drive letter]: Display All Sub-directory trees

Tree/F displays both the file name and Directory

Tree/A displays the directory tree in ASCII code

[Example] C: \ Windows> tree/??

Unformat restore a formatted disk

[Suggestion] Have you formatted a floppy disk with important information? Use unformat ...... What? You used format/U.

[Method] unformat [drive letter] restore the specified disk to be formatted

Unformat/L display the file name found by unformat

[Example] C: \ Windows> unformat :??

Vsafe virus protection program

[Suggestion] loading it into memory can detect many viruses at any time, which is quite useful.

[Method] Loading vsafe in memory

Vsafe/u remove vsafe from memory

Vsafe/ne Mount vsafe into extended memory

Vsafe/NX Mount vsafe into extended memory

The parameters include ax CX n d.

[Example] c: \> vsafe

Server displays DOS version

[Example] c: \> ver

?? The MS-DOS version 6.22

C: \>

Vol: displays the specified disk volume number.

[Example] c: \> vol ??

Volume in drive C is Wang

Volume serial number is 2116-1dd0

C: \>

Ctty Change Control Device

[Suggestion] This command can be used to change the input/output device of the control, but it may not be useful. It is one of the most useless commands in DOS.

[Usage] ctty [device name] setting Console

[Example] C :\> ctty aux ?? Set aux as the input/output device.

Are you dazzled by the introduction of so many commands? The key to learning DOS is to practice more commands, but you have to wake up. Be careful with some commands, or you will regret them later.

Del *. * Delete all files in the current directory

[Suggestion] Using del *. * In the C root directory will make the computer unable to find the mouse, drive, use windows, or even start. In fact, you need to consider using this command in any directory.

Deltree *. * Delete all directories and files in the current directory

[Suggestion] to use this command in the C root directory, you must ensure that your mind is clear and that this is necessary, however, we do not think this command should be used in any situation. Using deltree *. * In any directory will produce the same or even worse results as del. Be cautious! Be cautious!

Format C:/u format drive C

[Suggestion] unless your hard disk is infected with a virus, or a real computer expert tells you to do so, do not format the C disk, which will cause you to lose everything, it also takes several hours to reinstall all the software.

Fdisk hard disk partition

[Suggestion] When Using Hard Disk partitioning, make sure that someone who has used this command helps you to use it. Otherwise, you will lose all the information and may even be unable to use the hard disk.

Recover overwrite Disk

[Suggestion] This command will no longer be available after dos 6. If you are using an earlier version of DOS, advise you not to use it at any time, it does not work unless it destroys all the information on your hard disk.

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.