Computer and Software Support


Syntax

There is a certain order that the commands have to be entered in order for it to work or you will get an error. Syntax means the order that the dos command is typed. 

Command Syntax Elements

 

Example line for 1 through 11 is

COPY C:\TEST.TXT A: /V

1. Command Name

The name you enter to start the DOS program is called Command Name (a few of the DOS commands can be entered using shortcut names). The DOS command name is always entered first. 

Copy is the command name

2. Space

Always leave a space after the command name.
 

Press the spacebar to put a space between COPY and c:\test.txt


3. Drive Designation

If you are using a DOS command that requires a Drive Designation, you will need to enter that drive designation if the drive that you need is different from the drive that you are currently in. For example, If you are currently at drive C and you want to copy the file test.txt from drive C to drive letter A, you would type

COPY TEST.TXT A:

The reason for that is because the file is located in the C drive and your in the C drive. When you don't enter a drive, DOS assumes you are referring to the drive that your currently in. Now if you was currently on the A: drive, you would have typed

COPY C:\TEST.TXT A:

4. A Colon

When referring to a drive in a DOS command, you must always follow the drive designator with a colon (:) (this is how DOS recognizes it as a drive designation).
 

C:

5. Pathname

A pathname (path) refers to the path you want DOS to follow in order to act on the DOS command.
 

\ which is the backslash


6. Filename

A filename is the name of a file stored on disk. 

 

TEST

7. Filename Extension

A filename extension can follow the filename to further identify it. The extension follows a period and can be of three or fewer characters.

 

.TXT


8. Switches

Characters shown in a command syntax that are represented by a letter or number and preceded by a forward slash (for example, "/P") are command options (sometimes known as "switches"). Use of these options activate special operations as part of a DOS command's functions.
 

/V