KnowledgeBase Archive

An Archive of Early Microsoft KnowledgeBase Articles

View on GitHub

Q75127: How to Modify the Command Prompt within MS-DOS Shell

Article: Q75127
Product(s): Microsoft Disk Operating System
Version(s): MS-DOS:5.x,6.0
Operating System(s): 
Keyword(s): 
Last Modified: 17-DEC-2000

-------------------------------------------------------------------------------
The information in this article applies to:

- Microsoft MS-DOS operating system versions 5.0, 5.0a, 6.0 
-------------------------------------------------------------------------------

SUMMARY
=======

To modify the prompt when using the Command Prompt program item in MS-DOS
version 5.0 or later Shell, do the following:

1. Highlight the Command Prompt program item and choose Properties from the File
  menu. Modify the Commands option to the following

  <name>.BAT

  where <name> is any filename you want to specify. The default is
  COMMAND. <name>.BAT should replace COMMAND.

2. Create the batch file <name>.BAT. It should include the following:

     echo off
     set pr=%prompt%           ; Saves the current prompt
     prompt <message>%prompt%  ; Makes a new prompt
     command                   ; Spawns a new COMMAND.COM file
     prompt %pr%               ; Resets the prompt

  <message> can be any characters or escape sequences you want to include
  in the prompt. The prompt cannot be more than 127 characters in length.

3. Type "EXIT" (without the quotation marks) to reset the prompt and return to
  Shell.

The above procedure will not modify the prompt when you use the SHIFT+F9=Command
Prompt option. This method will return you to the current COMMAND.COM, leaving
Shell resident.


Additional query words: 5.00 5.00a 6.00

======================================================================
Keywords          :  
Technology        : kbMSDOSSearch kbMSDOS600 kbMSDOS500 kbMSDOS500a
Version           : MS-DOS:5.x,6.0

=============================================================================

THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Copyright Microsoft Corporation 1986-2002.