Solved

Create Batch File with Color in it

Posted on 2008-10-10
6
1,610 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
Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

 
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 500 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

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

If your system is showing symptoms of browser hijacks or 'google search redirects' check out my other article (http://rdsrc.us/u3GP7A) first and run the tool TDSSKiller (http://rdsrc.us/GDBBs4) to get rid of the infection. Once done, and if the …
For both online and offline retail, the cross-channel business is the most recent pattern in the B2C trade space.
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…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

713 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