2.0  Using DOS

2.6 General Commands:

 


TYPE

 

Type: Internal

 

Syntax: TYPE [d:][path]filename

 

Purpose: Displays the contents of a file.

 

Discussion

 

When you use the TYPE command, the file is displayed with limited on-screen formatting. Tabs are expanded and generally displayed as eight spaces wide. If you display files that contain special (non-text) characters, these characters may have unpredictable effects on your display.

Wild card characters (? and *) cannot be used with this command in either the filename or the extension.

 

For more information on using the TIME command, refer to Chapter 2, Using Common DOS Commands.

 

Example

 

To display the contents of the file LETTER3.TXT on drive B, enter

 

type b:letter3.txt

 


Date

 

Type: Internal

 

Syntax:   DATE

DATE mm-dd-yy

 

Purpose: Displays current date setting and provides a way to reset the date.

 

Discussion

 

You can enter the DATE command alone and the program will prompt you when to enter the date. You can also enter the date at the same time you enter the date command. Either way, you must enter the date in the following format:

 

The date you set will be used by DOS to ³date stamp² files that are created or modified. This date will be shown when you use the DIR command to display information about files.

 

You can specify the numbers to set the date at the same time you enter the DATE command or you can enter the command alone and the program will prompt you to enter the date.

 

Example

 

When you enter date, if the current date is set the program will display

 

Current date is Sat 04-04-2001

Enter new date (mm-dd-yy):

 

Press Enter to leave the date as it is, or type in the date using the format shown. Be sure to enter one or two numbers to indicate the month, then a hyphen, one or two numbers to indicate the day of the month, another hyphen, and one or two numbers to indicate the year. For example, to set the date on April 14, 2001, enter 4-14-01

 

 

Time

 

Type: Internal

 

Syntax:   TIME

TIME hh:mm[:ss][.cc][A|P]

 

Purpose: Displays current time setting of system clock and provides a way for you to reset the time.

 

Discussion

 

You can enter the TIME command alone and the program will prompt you when to enter the time. You can also enter the time at the same time you enter the time command. Either way, you must enter the time in the following format:

 

HH:MM:SS.CC

 

where HH is a one or two digit hours designation, mm is a one or two digit designation of minutes after the hour, SS is a one or two digit designation of seconds after the minute, and CC is a one or two digit designation of the hundredths of a second past the second. The following numbers are allowed:

 

HH 0-23 for hours

MM 0-59 for minutes

SS 0-59 for seconds

CC 0-99 for hundredths of seconds

A|P A.M. or P.M. (default is A.M.)

 

Only the hour setting and the minute setting are required. The following are allowable settings:

 

04:23

4:03

11:5:09

17:59:02.22

2:3:2.9

 

NOTE:

Your version of DOS may require slightly different forms of this entry format.

 

If you enter the TIME command without any time designation, the screen will display:

 

Current time is HH:MM:SS

Enter new time: __

 

You can enter a new time or press the Enter key to leave the time setting as it is.

 

If DOS carries out a time-dependent function (such as time-stamping a file for storage on a disk), the system time (based on the starting time you set) will be used. On some computers the system time is maintained by a battery-backup system; in this case, you will rarely use the TIME command (you can stop the initial presentation of both the DATE and TIME prompts by creating any AUTOEXEC.BAT file that does not include these commands). Other computers lose the system time whenever the computer is turned off. In this case, it must be reset each time the computer is restarted.

 

 


PROMPT

 

Type: Internal

 

Syntax:  PROMPT [prompt text][options ]

 

Purpose: Changes the DOS command prompt.

 

Discussion

 

You can change the DOS prompt (the indicator that DOS is ready for input) to almost any type of special prompt you want. For example, you can use this command to make the prompt display the current time, the date, or the current directory. You can also use combinations of the special prompt characters to create custom prompts.

 

If you use the PROMPT command with no options , the prompt will be set to the default prompt (the current drive letter and a greater-than symbol). By using the characters indicated in the following list, you can create a great variety of prompts (each must be preceded by a dollar sign):

 

Examples

 

To change the prompt to display the current drive and directory and a greater-than symbol, enter

 

prompt $p$g

 

You can also create more complicated prompts. For example, to use the same prompt as above, with two added spaces and the characters TIME= followed by a display of the current time, enter

 

prompt $p$g TIME=$t

 

The resulting prompt (if you are working in the DOS directory on drive C) will look like this:

 

C:\DOS> TIME=11:07:54.23


Copyright © 2001 Selfonline-Education. All rights reserved.