Sideway
output.to from Sideway
Draft for Information Only

Content

MS DOS Command: PROMPT
 Description
 Syntax
 Parameters
 Related Commands
 Remarks
  Using the PROMPT command without the text parameter
  Using the $P value for text
  Defining the MS-DOS command prompt in Windows
 Examples

MS DOS Command: PROMPT

Reference from Microsoft MS-DOS cmd help

Description

Changes the appearance of the command prompt.

You can customize the command prompt to display any text you want, including such information as the name of the current directory, the time and date, and the MS-DOS version number.

Syntax

PROMPT [text]

Parameters

text Specifies any text and information you want included in your system prompt.

The following list shows the character combinations you can include instead of, or in addition to, any character string(s) in the text parameter. The list includes a brief description of the text or information that each character combination adds to your command prompt.

$Q = (equal sign)
$$ $ (dollar sign)
$T Current time
$D Current date
$P Current drive and path
$V MS-DOS version number
$N Current drive
$G > (greater-than sign)
$L < (less-than sign)
$B | (pipe)
$_ ENTER-LINEFEED
$E ASCII escape code (code 27)
$H Backspace (to delete a character that has been written to the prompt command line)

Related Commands

For information about setting the current date and time, see the DATE and TIME commands.

For information about ANSI escape sequences, see the ANSI.SYS topic.

Remarks

Using the PROMPT command without the text parameter

When you use the PROMPT command without specifying a value for text, PROMPT resets the command prompt to the default setting--the current drive letter followed by a greater-than sign (>).

Using the $P value for text

If you include the $P character in the text parameter, MS-DOS reads your disk after you enter each command to determine the current drive and path. This can take extra time, especially for floppy disk drives.

Defining the MS-DOS command prompt in Windows

If you use Microsoft Windows 3.1, you can change the command prompt with the WINPMT environment variable.

For example, suppose you want the following message to precede the MS-DOS command prompt:

Type "exit" when you're ready to return to Windows.

To display this message, include the following command to your AUTOEXEC.BAT file:

set winpmt=Type "exit" when you're ready to return to Windows.$_$p$g

Examples

The following example sets the command prompt to display the current drive and path followed by the greater-than sign (>):

prompt $p$g

The following command displays a two-line prompt in which the current time appears on the first line and the current date appears on the second line:

prompt time is: $t$_date is: $d

If your CONFIG.SYS file loads ANSI.SYS, you can use ANSI escape sequences in your prompts. The following command, for example, displays your prompt in reverse video mode and returns to usual video mode for other text:

prompt $e[7m$n:$e[m

The characters following the escape code ($E) are ANSI escape sequences.


©sideway

ID: 110700239 Last Updated: 7/29/2011 Revision: 0


Latest Updated LinksValid XHTML 1.0 Transitional Valid CSS!Nu Html Checker Firefox53 Chromena IExplorerna
IMAGE

Home 5

Business

Management

HBR 3

Information

Recreation

Hobbies 8

Culture

Chinese 1097

English 339

Travel 18

Reference 79

Computer

Hardware 254

Software

Application 213

Digitization 37

Latex 52

Manim 205

KB 1

Numeric 19

Programming

Web 289

Unicode 504

HTML 66

CSS 65

SVG 46

ASP.NET 270

OS 431

DeskTop 7

Python 72

Knowledge

Mathematics

Formulas 8

Set 1

Logic 1

Algebra 84

Number Theory 206

Trigonometry 31

Geometry 34

Coordinate Geometry 2

Calculus 67

Complex Analysis 21

Engineering

Tables 8

Mechanical

Mechanics 1

Rigid Bodies

Statics 92

Dynamics 37

Fluid 5

Fluid Kinematics 5

Control

Process Control 1

Acoustics 19

FiniteElement 2

Natural Sciences

Matter 1

Electric 27

Biology 1

Geography 1


Copyright © 2000-2025 Sideway . All rights reserved Disclaimers last modified on 06 September 2019