DOS commands Detailed _dos/bat

Source: Internet
Author: User
Tags current time goto parent directory reserved

The format of the DIR command:

dir [D:][path][name][[/a][:attrib]][/o:[sorted][/s][/b][/l][/c[h]

(1) Dir/a:attrib default contains all files (System files. hidden files)

Attrib[:][h/-h] Displays only hidden or not suppressed files.

[R/-r] Displays only read-only or non-read-only files

[S/-s] Displays only system or non-system files

[A/-a] only displays files or files that are not archived

(2)/o[:]sorted: The default is completely alphabetical, subdirectories appear before the file

/O[N/-N]: In alphabetical order or in File name order/reverse Display

[E/-E]: By extended first name order/reverse Display

[d/-d]: Chronological/reverse Display

[S/-s]: size from large to small or/reverse display

[G/-g]: by subdirectory before the file or file before the subdirectory

(3)/s parameter: Lists all files in the current directory and its subdirectories

Column Name: Dir/s/a/o:n c:\>prn

Document all subdirectories and files on C disk by affiliation and print out alphabetically by subdirectory and file

(4)/b parameter: will only display file name and extension

(5)/L parameter: List all files or subdirectories in lowercase letters

Training:

dir/a all files in current directory (including implied and system files)

The Dir/ah column implies a file containing subdirectories (implied) dir/a-h

Dir/as Column System File Dir/a-s

DIR/AD Catalog dir/a-d

DIR/O in alphabetical order

Dir/b only displays file names and extensions

 

 

Ii. attrib [+r|-r] [+a|-a] [+s|-s] [+h|-h] [D:] [name] [s]

Default attrib name to display file (file) properties

attrib Io.sys (or subdirectory)

SHR C:\ Io.sys specified as system (s) implied (h) Read-only (R) file

You can also attrib *.sys to display file attributes with the extension sys

parameter [+r|-r] Sets or unlocks the property of the file as read-only

[+a|-a] Sets or unlocks the properties of a file

[+h|-h] Sets or suppresses the properties of the file (especially the subdirectory also works)

The/s parameter will work on all files under current and current subdirectories

Can be used to find files

Example:

Document properties for attrib news86 column news86

attrib +r report.txt set to read-only attrib-s-H record.txt

attrib +a a:*.*

Attrib-a A:*.bak

xcopy A:B:/A copy of all files on a disk that are marked as "archive" to disk B

xcopy A:b:/m to copy all files on a disk to disk B and remove the archive attribute

 

 

Third, CD Introduction: CD ... Return to level Two directory "." Represents the current directory "." Represents the parent directory

Cd.. \.. Returns to the parent directory (ancestor directory) of the parent directory

CD a:\ Change the current directory of a disk to the root directory

CD A:\XX changes the current directory of a disk to subdirectory XX

Cd.. \98 first returns to the parent directory and then 98 subdirectories under the parent directory

Cd.. Return to Parent Directory

Cd\98 into 98 subdirectories under the root directory

 

 

Iv. copy [/y][/-y][/v][/b]

copy/y to overwrite all files without prompting

/-y to be prompted for all documents (yes or no questions)

/V Copy to be validated later

/b display in binary system

Copy w1.wps con/b can display the WPS file on the screen without having to go into the WPS state

Copy.. \98 all files in the 98 subdirectories under the parent directory to the current subdirectory

Copy. \97 all files in the current directory are copied to the current directory under 97 subdirectories

Copy. C:\ Copy all files in the current directory to C packing directory

. means the *.* file

Copy nul a.abc a.abc file empty (file length to 0)

Copy filename +con append commands or content to a text file

Copy con filename Create text file (F6 disk exit)

Copy con prn check the printer switch

 

 

V. Xcopy order

xcopy [source] [d:date] [/p] [/s] [/e] [v] [/y]

xcopy [D:date] xcopy a:b:\/d:08/18/98/s/v copy 98.08.18 years after the document

xcopy [/p] prompt to create subdirectories

xcopy [/s] associated subdirectories are copied together. Note: If this subdirectory does not exist on the destination disk, the target

The Terminator of the disk does not end with "\", you will be prompted:

Does destination specify a file name or directory name on the target

[F=file,d=directory]?

Create a file on the target disk [press] or create a subdirectory [press d]? d key should be selected

XCOPY[/V] with more tests

*:(1) xcopy does not copy system and implied files, it should modify the attributes before copying

xcopy [/y] Overwrite when there is a hint,/y without prompting

If you omit the destination disk or subdirectory name, copy to the current directory

 

 

 

VI. del/p

Plus/p to prompt before deleting

If the subdirectory name is added after the Del, all files under the subdirectory (implied. System. Except for read-only files) are deleted.

Plus/P can be confirmed.

 

 

 

Vii. undelete [name]/au

Restore all files that meet the criteria without prompting (recoverable) and place the initials "#", if they are

exists, the "#% & 0 1 2-9-A-Z" sequence is added.

For example: Undelete *.dbf/au restores all files with the extension "dbf" and begins with "#" as a file

Name,/list only lists recoverable files without restoring

Undelete/load load Undelete into memory

/unload Remove Undelete from memory

/s[drive] Monitor management of specified drives

Undelete/sc

Will undelete reside in memory,? and create an implied sentry subdirectory on C-disk deleted files

Manage Undelete/ds Recovery

The corresponding restore command can be undelete to restore the file name completely (very complete)

Most commonly used undelete *.*

deltree/y [Drive:path]

deltree deletes subdirectories and files, although some files are system files or hidden files

It can have wildcard characters, and it will delete eligible files and subdirectories when it has wildcards

For example:? Undelete *.dbf/au restores all files with the extension "DBF" and starts with "#" as a file

Name.

/list only lists recoverable files and does not restore operations.

Undelete/load loads the undelete into memory.

/unload the undelete out of memory.

/s[drive] Monitors management of the specified drive.

UNDELETE/SC will undelete reside in memory and create an implied sentry subdirectory for C-disk deletion

Files for management. The corresponding restore command can be fully recovered with the Undelete/ds file name (perfect).

The most common is undelete *.*.

 

 

 

Viii. deltree/y [Drive:path]

deltree deletes subdirectories and files, although some files are system or implied.

It can have a wildcard character, and it will delete the eligible file or subdirectory.

such as: Presence of L1 files, L2 subdirectories, L3 files, L4 subdirectories

deltree l*.* will delete all of the above files and subdirectories, but confirm them before deleting them, and if they are not deleted,

You can enter "N".

The/y parameter is operated without confirmation when it is deleted.

Its deleted files can be recovered with undelete,? But you cannot restore subdirectories and the files under them, you can use the special

Tools, such as Norton 8.0.

If you use undelete/s in advance, you can find the full file in the Sentry subdirectory, but the name is

Changed.

IX, Dos=high[|low[umb|noumb]]

Dos=high,umb DOS will mount itself into high-end memory (high) and manage upper memory (UMB).

Noumb does not manage the upper memory.

Mount Device=himem.sys before writing to Dos=high and UMB

In order to load a program or driver into the upper memory, you must use Dos=umb to save most of the conventional memory.

You can write Dos=high,umb anywhere in Config.sys.

displaying HMA not avoiable or load down-low indicates that high memory cannot be used.

Ten, Doskey record before the DOS command, you can use F7 to display, with "↑↓" to choose, with F9 to enter

The selected command number.

Doskey/restall again, the previous command line was undone.

Doskey/history displays all commands in memory and can be ">" displayed in other files, abbreviated "/h".

Doskey Dir=cls the same as the CLS by clicking Dir.

Doskey/macros can display all macro definitions and can be redefined to a file by using ">", abbreviated to "/M".

Doskey dir= can undo the macro definition of dir.

Doskey p=dir$tdir*.exe/p$tdir C:\t$tdir c:\t$*

$t is the $* of the command, and the Terminator for the command

Doskey/insert (overstrike)? When you re-enter the command, modify the old command to insert or overwrite

Cover status (default).

Xi. Emm386.exe

Provides management of extended memory to enable applications to use it as if they were using conventional memory.

The common usage is in Config.sys.

Device=c:\dos\himem.sys

Device=c:\dos\emm386.exe RAM

D=64 Set DMA memory quantity to 64K

Noems provides access to the upper memory, but does not provide access to extended memory.

It should be noted that it is best not to use it in Windows because Windows itself has managed to extend memory

Program. You should use the manager in Windows.

12, FC Command fc/b Dt.dat dt2.dat>b (for binary code comparison)

Compare two files, generally used as access progress, modify game storage files.

The actual code location should be added 0100 such as: 0000 05e4:00 67

The actual use of DEBUG-E modification should be added 0100 that 0000 06e4:00 67

The following plus the redirected file ">p" can output the comparison results to the P file.

 13, format/q/u/s/n:sectors/f:size/c

/q parameter: Quick format, only the file allocation table and the root zone are scanned, only valid for the formatted disk.

Use it to ensure that no new bad passes are added after formatting.

/u parameter: Unconditionally formatted, and do not save the information on the original disk, you can prevent "unformat".

/s parameter: Format the system disk, or use the "sys" command.

/f:size size can be 160 180 320 360 720 1200 1440 2800

/n:sector n can be a one-sided disk with a capacity of 160k 180k for 1 format

360k disks can be formatted for 4 on a 5-inch high density drive

You can format 8 sectors on 5-inch high-density drives for 8.

/C re-test bad sector, by default if one sector is marked "bad", then the format is not new

Try, only mark, use "/C" can be a new test.

14, Unformat command

For a command that has been formatted with format and does not use the "/u" parameter, it can be used to repair the damaged

Bad hard disk partition table, but does not work on the network disk.

Unformat drive:[/l][/test][/p]

/l displays each file and subdirectory found by the Unformat, without this switch, displays only those

Broken files and subdirectories, you can pause with ctrl+s, press any key to continue.

/test only a test, not to do the actual repair work, as a simulation process.

/p prints while testing side.

Note: This method does not guarantee that all files will be repaired, especially if the disk has been formatted and added to the data.

The recovered files are stored in sequence in SubDir1 .... 2....3 in a subdirectory.

The Interlnk grammar interlnk g=e, it can communicate between two machines through a serial port or a port.

Map the E drive on the server side to the client's G drive, and in the future for the client, all

Operation means access to the server, and the way to cancel the mapping is Interlnk g=

The individual input Interlnk shows all the mappings.

Note: Interlnk must be loaded into the Interlnk.exe device driver before it can be used.

The drive symbol and config used.? The number of Lastdrv.exe settings in SYS is related. Can make a

The end of the 25-pin, the other end of the 9-pin serial line implementation, the specific wiring method is as follows:

5-7 2-15

3-2 3-13

7-4 4-12

6-6 5-10

3-3 6-11

8-5 15-2

4-20 13-3

9-pin 25-pin 12-4

10-5

11-6

25-25

25-pin 25-pin

16, Interlnk.exe and Intersvr.exe

Interlnk.exe REDIRECT requests for a client drive or print interface to another server driver

Device or printer.

Syntax: adding in Config.sys:

Device=c:\dos\interlnk.exe [Drive:n][/noprinter][com][lpt]

17, Memmaker[/b][/batch][session][/swap:drive]

Use MemMaker to optimize memory configuration, and write configuration to Autoexec.bat and Config.sys.

In this process, you need to restart the machine several times.

18, Memitem memcolor Memdefault submenu menu options include

The Autoexec.bat is as follows: Config.sys in the following:

Path C:\dos;c:\ucdos [Menu]

Doskey menucolor=15,1 (foreground color 15, background color 1)

\mouse\mouse Menuitem=base_config,this is a base

Goto%config%-> Selection menuitem=cced_config,this is a cced

Option hint

: Base_config menudefault=base_config,5

Goto exit-> out default for Base_config, delay time 5 seconds

: Cced_config [Common]

C:\DOS\SMARTDRV.EXE/L Device=c:\dos\himem.sys

Goto exit A common part of each

: Exit-> End [Base_config]

Device=c:\dos\emm386.exe RAM

Dos=high,umb

[Cced_config]

Device=c:\dos\smartdrv.exe/double_buffer

Include=base_config contains base_config settings

Can be selected according to the configuration requirements of the computer in different situations.

19, Mscdex.exe to provide optical drive to read and write procedures

mscdex/d:drive [/d:drive][/e][/k][/s][/l:letter]

Typical: device=c:\cdrom\cdrom.sys/d:mscd000 in Config.sys

Autoexec.bat in C:\dos\mscdex/d:mscd000/l:g

An optical drive is configured with the symbol G

The parameter/d:drive1 is the optical drive identity number, must be consistent with the symbol in the Config.sys, may have many

/d:mscd000/d:mscd001

/e: Load the optical drive driver with extended memory.

/s: Make the optical drive in ms_net or Windows set to shared optical drive

/V whether memory is displayed at load time.

/l:letter assigned to the drive letter

/M:NUMBER Specifies the number of buffers

It should be noted that: if using Smartdrv.exe to speed up the reading and writing ability of the light drive, it should be in AUTOEXEC.

BAT will mscdex.? EXE written in Smartdrv.exe before, Smartdrv.exe use can greatly improve

Ability to read and write to drives.

20, the use of MSD

Use MSD to check the computer configuration and system information as a whole

Includes:? Drive parameters, computer CPU parameters, memory size parameters, display type, string. And the mouth condition to

And each IRQ occupancy, you can analyze whether the new device conflicts with the original device.

At the same time can also be analyzed by the memory-resident program to determine whether there is a virus in memory, is labeled as "???."

21, Prompt DOS prompt

$q equals number $t current time $d current date $p current drive symbol

$$ $ $n The current drive $g greater than $l less than sign $b show | Pipe number

$h to the prompt $E display the "<-" number

For other text, displays the text itself prompt Ljw, which is displayed as the LJW prompt

Prompt displays only the current drive letter and the greater-than number.

22, Ramdrive.sys use memory as a virtual disk to use

It should be noted that all data exist in memory, should be stored in time to the hard disk, otherwise lost power or panic

All data will be lost, with the advantage of running fast, but not in Windows.

Example: Config.sys:device=c:\dos\ramdrive.sys/size[/e|a]

Size is the number of bytes in K, that is, the amount of virtual disk that was established.

/e or/A uses extended memory to set up a virtual disk. The prerequisite for adding parameters is that memory management must be loaded first

Device Himem.sys and Emm386.exe.

23, subst a drive with a subdirectory to join

For example, if a request to a A:\L1\L2 subdirectory is mapped to an S disk, the input

Subst S:a:\l1\l2 can be

This uses the dir s:? The commands are displayed in the A:\L1\L2 subdirectory, as in the other copy del

You can use subst s:d to cancel this mapping.

You can use subst to display a variety of joins

Note: You can use subst a:c:a to create a read-write disk for a. For some installation software

, you must use a disk to install, you can use the software that you want to install to the C:A

Directory, then enter subst a:c:a, then go to a:, you can install the software.

24. MEM/C/m/p/d General Memory Display program

/C shows the occupancy of all memory-resident programs, divided into conventional general memory and Uppermemory

High-end memory footprint and shows total occupancy (conventional high-end reserved extended memory)

/p paging display, pausing between pages

The module name:/M MSDOS shows the memory footprint of the DOS system after/M.

/d Detailed example table description of conventional high-end reserved extended memory

Through analysis, you can see whether the memory consumption is reasonable, and the various programs are loaded normally, so that the base

The main use of memory optimization tool MemMaker for a variety of management, but also can analyze some program panic

, if there is a "???" in some places, it can be concluded that there is a virus in memory, which is conducive to discovery and elimination.

25, >> "> The use of various pipe tools" > < >> <<

Redirect output or required input from various commands

For example, dir *.bat/b>p can output the file name of dir *.bat to the P file.

Time<p>>p.bat

Only one carriage return exists in the P file, you can append the time to the P.bat file

> >> redirects output from a command, such as to a file or printer.

>> The resulting content will be appended to the file,> will overwrite the original file contents.

"< <<" is to redirect what the command needs to enter.

such as: Time<p in the batch can be a time code or a carriage return, you can change the time.

Note that "PRN" is a printer, "null" is an empty device

Con for Monitor

Type P.BAT>PRN can print the P.bat.

Copy null p to delete p files

Copy con p can edit the P file on the screen, F6 can save and exit

Type P>PP completes the copy of P file to pp

Type P|more can be paused when the screen is full

26. Move command

Move [y/-y] filename1 filename2

Move file 1 to file 2

such as: Move C:\dos\*.* c:\cced

Move all files under the DOS subdirectory to the cced subdirectory

/y|-y parameter prompts when the target directory does not exist and needs to be created

You can use this command to modify subdirectory names, such as Move DOS cced

Change DOS directory name to cced

27, append specify some special data file storage location, such as User.dat Pe2.pro and some other non * *.

EXE *.com *.bat file

Format: Append [:] Terminate previously existing specified directory append display specified condition

Append [path] append C:\User

28,

Call calls another batch file in a batch command

(1) Do not terminate the operation of the existing files, and return immediately after the execution of the program.

(2) The called Batch command must be extended with bat

(3) When calling batch files, you can add parameters (%1-%9) and environment variables such as%baud%

(4) Cannot use piping tools and redirection tools

29, Device Devicehigh Loadhigh

Device to load the specified device driver into memory

Devicehigh the specified device driver into high memory

Loadhigh the specified device driver into high memory

30. Defrag optimized disk

Legend (legendary) optimize (optimized) elapse (gone) fragment (fragments)

This command performs optimized processing of the specified disk (including checking the file allocation table, file status, correcting errors)

, you can sort the files by file name size, time, and extension when you execute them.

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.