-4

I need to write a batch script which configures this list of commands:

  1. Put the name of the window "Cmd configuration"
  2. Put the color of the text in green.
  3. Put the prompt character "$"
  4. Show the message "Cmd is configured"
  5. Ends by keeping the window open..

This is what I already have:

@echo off  
title cmd configuration  
color a  
prompt $  
@echo off  
Echo cmd is configured
1
  • 1
    I've reopened this but you might want to add an actual question here. Doesn't the script work for you?
    – slhck
    Jan 23, 2013 at 22:10

2 Answers 2

2

This will do all that you asked.

@echo off
cmd /k "title Cmd configuration& color A & prompt $$ & echo Cmd is configured"

Output:

Cmd is configured

$

This next one removes that blank line between the prompt and message.

@echo off
cmd /k "title Cmd configuration& color A & prompt $$ & <nul set /p =Cmd is configured"

Output:

Cmd is configured
$
0

You want to write a batch script (.BAT) that executes the list of commands. The name of the window can be anything, just use the form TITLE [title here]. The command to make the text green is in fact COLOR A, and the prompt character can be changed by using PROMPT $. Saying "Show the message" is a little vague, because you might want to have a message box pop up, or you might want to have it show in the command prompt. ECHO does print these characters, but unfortunately, it cannot keep the window open. However, you can pause the exit by using PAUSE. Therefore, your script should be as follows:

@ECHO OFF
TITLE Cmd configuration.
COLOR A
PROMPT $
ECHO\ Cmd is configured.
PAUSE

Note that you can test a batch script by double-clicking on it.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .