Jump to content

how to cleanup command-prompt windows?


QKnet

Recommended Posts

I use .cmd file to do unattended installation of several of my software.

What should I do (and how) to get the command-prompt windows display only the description of what is being done. Something like

Installation of Office 2003 SP1...  [done]Installing Nero Burning Rome.... Please wait....

rather than displaying the whole command.

Link to comment
Share on other sites


best thing i know to do is use the 'start' command and have the first parameter be a string containing whatever you want it to display, however, it will still show the entire command being run after the specified string. you may have to use 'start' in conjunction with 'call' (ie 'start "my app name" call mybatchfile.cmd')

another method is to use the 'title' command. just run this with the title you want as a parameter and it will change the title, hoever, it will still show the command after it as above.

choose your poisen

you may want to check out using the RunOnceEx Reg key instead.

i beleive that gosh has published some very helpful how-tos in that area.

gosh's webpage

hope that helps

-Voltaic

Link to comment
Share on other sites

@echo Installation of Office 2003 SP1...  Please wait....
@echo off
start /wait command
cls
@echo Installation of Office 2003 SP1...  [Done]
@echo Installing Nero Burning Rom.......  Please wait....
@echo off
start /wait command

Something like this maybe?

Link to comment
Share on other sites

Just a small and quick clarification:

-you need "@echo off" (w/o quotes) on your very first line of your batchfile (and it's only needed once)

-the following lines (when you want to write something to console) should be just "echo", not "@echo"

-if you don't want to see "x files copied" and such messages too, just add " > nul" after them ie "copy source destination > nul" but keep in mind if something goes wrong (like if it asks to overwrite) you won't see a thing and you won't know what went wrong, so it's good to use only on previously tested stuff.

-use cls when you want to clear the screen completely (like right after @echo off)

RunOnceEx is good for some people, but I don't like it and it's not good for my purposes, to each their own :)

Link to comment
Share on other sites

Try this

echo off
mode con: cols=55 lines=3
color 9f
echo hello
pause

That will make a cmd screen that blue with yellow txt and in a small retangle cmd box.

This line controls the size of the cmd screen

mode con: cols=55 lines=3

This controls the color on screen and text

the colors range from  A B C D E F to 0-9

color 9f

Link to comment
Share on other sites

the colors range from  A B C D E F to 0-9

That doesn't really make sense. A B C D E F is an enumeration and 0-9 is a range... ranging from an "enumeration" to a range? 0 to F would be more appropriate.

It's hex (base 16). First 4 bits are for back color and the next 4 for foreground. 00-FF in hex is equivalent to 0-255 in decimal... It's nothing complicated.

Either ways, peronally I see no benefit to changing the colors, I'd rather keep the default ones.

Your echo off is missing the @, and I wonder why would anyone want such as tiny window too.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...