Solved

Create Batch File with Color in it

Posted on 2008-10-10
6
1,606 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
U.S. Department of Agriculture and Acronis Access

With the new era of mobile computing, smartphones and tablets, wireless communications and cloud services, the USDA sought to take advantage of a mobilized workforce and the blurring lines between personal and corporate computing resources.

 
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

Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

Question has a verified solution.

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

Can I legally transfer my OEM version of Windows to another PC?  (AKA - Can I put a new systemboard in my OEM PC?) Few of us are both IT and legal experts but we all have our own views of Microsoft's licensing rules and how they apply.  There are…
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…
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

776 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