Change file attributes. ‘+’ adds an attribute, ‘-‘ removes it. Attributes are: A=archive; R=read only; S=system; H=hidden.
ATTRIB -R -A -S -H
All these attributes will be removed from virus.exe.
Go to the C: drive. Similarly A: and D: etc.
Change directory. When you change directory, the prompt changes, showing the path of the directory you are currently in.
Make directory. Creates a new directory below the current one. (The command can also be written as MKDIR)
Clear the screen.
Delete one or more files in the current directory. Can be used with the ‘*’ and the ‘?’ wildcards.
DEL *.* will delete ALL files in the current directory, USE WITH CAUTION.
DEL deletes virus.exe
DEL *.JPG will delete all files with the extension JPG.
DEL MY*.* will delete all files beginning with MY and with any extension.
DEL MY??.* will delete files that are 4 characters long and begin with MY and with any extension.
Displays the contents of a directory (folder).
Note, directory is the term used by DOS for what Windows calls a folder.
DIR displays all files and folders in the current directory. Folders are indicated in the list by
DIR /W displays the files/folders in multiple rows. This view gives less information per file.
DIR *.JPG displays all files with the extension JPG in the current directory and all subdirectories.
DIR MY??.* displays all files beginning with MY, exactly 4 characters long, and with any extension.
DIR /S lists the contents of all subdirectories.
DIR /AH displays all hidden files.
Runs DOS EDIT (a simple text editor). Useful for editing batch files and viewing logs. This command requires QBASIC.EXE to be present.
EDIT opens the file viruslog.txt and allows you to edit it.
EDIT creates a new file called newfile.txt and opens it up for you to edit.
Displays DOS Help. For help on an individual command, type HELP then the command for which you want more information.
Rename a file. You must use the full file name including the suffix.
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.
When you run a DOS command, output is usually sent to the screen. Use > to redirect output from the screen to a file. It runs the command 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.
COMMAND > FILENAME.TXT
e.g. SWEEP > REPORT.TXT The details of any infected files reported by SWEEP are sent to a file called REPORT.TXT.