Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Create Batch File with Color in it

Posted on 2008-10-10
6
Medium Priority
?
1,624 Views
Last Modified: 2012-05-05
I am in need of a little help creating a batch file that has color in it.  Below is the batch file that works just fine.  The person that is requesting this batch file would like the following in color so it stands out to the end user.

(This password is the one you use to log into your comptuer with.  Please  add xxx before your user name (example: xxx\username) then press enter.  You  will then be prompted for your password)

I have found out that I can change the whole screen differant colors, but I only what the above part in color.  Can this be done?

net use U: /delete
ECHO OFF
 ECHO  (This password is the one you use to log into your comptuer with.  Please  add xxx before your user name (example: xxx\username) then press enter.  You  will then be prompted for your password)
ECHO.
ECHO.  
ECHO.
 
net use U: "\\servername\shares\sharename" /persistent:yes
0
Comment
Question by:eServ
6 Comments
 
LVL 10

Expert Comment

by:MoreHeroic
ID: 22686383
How about something like this?  It should flash white for a brief second while that text is printed then everything goes back to whatever the batch file started as.

net use U: /delete
@ECHO OFF
COLOR f0
ECHO  (This password is the one you use to log into your comptuer with.  Please  add xxx before your user name (example: xxx\username) then press enter.  You  will then be prompted for your password)
COLOR
ECHO.
ECHO.  
ECHO.
pause
 
net use U: "\\servername\shares\sharename" /persistent:yes
0
 
LVL 13

Expert Comment

by:Nick Denny
ID: 22686417
Here is the list of colors:
0 = Black      
1 = Blue        
2 = Green      
3 = Aqua        
4 = Red        
5 = Purple      
6 = Yellow      
7 = White      
8 = Gray
9 = Light Blue
A = Light Green
B = Light Aqua
C = Light Red
D = Light Purple
E = Light Yellow
F = Bright White

Use:  COLOR  xx

One character specifies text. If used with 2, the first is background, then text.

To reset, use COLOR without parameters.
0
 
LVL 10

Expert Comment

by:MoreHeroic
ID: 22686472
0
Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

 
LVL 43

Expert Comment

by:Steve Knight
ID: 22686914
I do it as follows in a few scripts.  You can add a couple of Control G's to sounds a sounds too in the echo commands (use edit and enter them with Control P Control G.

Steve

@echo off
REM save as 1.cmd or whatever.  Change path to point to second batch
START /WAIT cmd /c c:\2.cmd
echo Continuing

@echo off
REM Save as 2.bat or change reference in above file
color cf
mode con: cols=80 lines=5
cls
echo This is the message to pop up
pause
exit
0
 
LVL 43

Accepted Solution

by:
Steve Knight earned 2000 total points
ID: 22686983
While you are at it add a title command and

@echo off
REM Save as 2.bat or change reference in above file
color cf
mode con: cols=80 lines=5
cls
TITLE PLEASE ENTER YOUR PASSWORD
echo This is the message to pop up
net use u: .....
exit
0
 

Author Closing Comment

by:eServ
ID: 31504988
Thanks for your help all seems to be working
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Today, still in the boom of Apple, PC's and products, nearly 50% of the computer users use Windows as graphical operating systems. If you are among those users who love windows, but are grappling to keep the system's hard drive optimized, then you s…
This article provides a convenient collection of links to Microsoft provided Security Patches for operating systems that have reached their End of Life support cycle. Included operating systems covered by this article are Windows XP,  Windows Server…
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…
Loops Section Overview
Suggested Courses

916 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question