How to Modify the Command Prompt within MS-DOS Shell (75127)

The information in this article applies to:
    Microsoft MS-DOS operating system 5.0
    Microsoft MS-DOS operating system 5.0a
    Microsoft MS-DOS operating system 6.0

This article was previously published under Q75127


To modify the prompt when using the Command Prompt program item in MS-DOS version 5.0 or later Shell, do the following:
    Highlight the Command Prompt program item and choose Properties from the File menu. Modify the Commands option to the following


    where <name> is any filename you want to specify. The default is COMMAND. <name>.BAT should replace COMMAND.
    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.
    Type EXIT 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.

Modification Type: Major Last Reviewed: 10/13/2003
Keywords: KB75127