Вы находитесь на странице: 1из 3

Command and Usage

Examples
ATTRIB -R -A -S -H <VIRUS.EXE>

ATTRIB

Change file attributes. '+' adds an attribute, '-'


removes it. Attributes are: A=archive; R=read
only; S=system; H=hidden.
C:

All these attributes will be removed from


virus.exe.

C:

Go to the C: drive. Similarly A: and D: etc.


CD

takes you to the top of the directory tree


(typically to C:) .
CD\

Change directory. When you change directory, the


prompt changes, showing the path of the directory CD.. moves you one level up the directory
you are currently in.
tree (i.e. up towards the root directory).

Note, directory is the term used by DOS for what CD <DIRECTORYNAME> takes you to that
Windows calls a folder.
directory. You can use one or more
subdirectory names, separated by \ e.g.
CD WINNT\Media takes you to the directory
C:\WINNT\Media
To change to another path, type the full path
with slashes. e.g.
CD \WINDOWS\SYSTEM
CLS

CLS

Clear the screen.


DEL

DEL <VIRUS.EXE> deletes virus.exe


Delete one or more files in the current directory.
Can be used with the '*' and the '?' wildcards.
DEL *.JPG will delete all files with the
extension JPG.
DEL *.* will delete ALL files in the current
directory, USE WITH CAUTION.
DEL MY*.* will delete all files beginning
with MY and with any extension.
(Note: DEL cannot be used to delete directories.
Use RD to remove a directory.)
DEL MY??.* will delete files that are 4
characters long and begin with MY and with
any extension.
DIR

Displays the contents of a directory (folder).

displays all files and folders in the


current directory. Folders are indicated in the
Note, directory is the term used by DOS for what list by <DIR>.
Windows calls a folder.
Files are usually listed by name.
DIR

These switches can be combined, so DIR /W /P DIR /P displays the contents a page at a
will return multiple rows listing a page at a time. time, i.e. as many as will fit in your command
line window. Press any key to display the next
You can use the '*' and the '?' wildcards to search page.
for a particular file. The ? character represents
ONE character, and the * character represents
DIR /W displays the files/folders in multiple
multiple characters.
rows. This view gives less information per
file.
DIR *.* lists all the files in a directory.
DIR *.JPG displays all files with the
extension JPG in the current directory and all
subdirectories.
displays all files beginning with
MY, exactly 4 characters long, and with any
extension.
DIR MY??.*

DIR /S

lists the contents of all subdirectories.

DIR /AH

displays all hidden files.

EDIT

EDIT <VIRUSLOG.TXT> opens the file


Runs DOS EDIT (a simple text editor). Useful for viruslog.txt and allows you to edit it.
editing batch files and viewing logs. This
command requires QBASIC.EXE to be present. EDIT <NEWFILE.TXT> creates a new file
called newfile.txt and opens it up for you to
edit.

HELP

Displays DOS Help. For help on an individual


command, type HELP then the command for
which you want more information.

MD

Make directory. Creates a new directory below


the current one. (The command can also be
written as MKDIR)

PRINT

Prints the specified file (if the printer is supported

HELP DIR

displays information on the DIR

command.

MD <NEWDIR>

creates a new directory called

Newdir.

PRINT <LOGFILE.TXT>

in DOS - many are not).

Prints LOGFILE.TXT

RD

RD <DIRECTORYNAME>

Remove directory. Removes a subdirectory of the


current directory. The directory you want to
remove must be empty of all files. (The command
can also be written as RMDIR)

RENAME

RENAME <OLDNAME.EXE> <NEWNAME.EXE>

Rename a file. You must use the full file name


including the suffix.

TYPE

TYPE C:\README.TXT|MORE

Displays the contents of a file on the screen. If


you use this command on a file which is not a text
file, the display will be unintelligible. Use with "|
MORE" to display the text on a page by page
basis, and prevent it scrolling off the screen. "|" is
a pipe character.

>

COMMAND > FILENAME.TXT

When you run a DOS command, output is usually


sent to the screen. Use > to redirect output from e.g. SWEEP > REPORT.TXT The details of
the screen to a file. It runs the command
any infec
preceding the >, creates a file in the current
directory with the name you specify, and sends
the information/output returned by the command,
to that file.

How to Create a File List at a Command Prompt

Вам также может понравиться