Windows Vista Tip: Adding a Custom Background Color to Admin Command Prompts

Microsoft was handy enough to add a custom title bar message that says “Administrator” when you elevate a command prompt. I wanted something a little more pronounced as I am often juggling between a few command prompts at once and glancing at the title bar hasn’t been stopping from using the wrong command prompt from time to time.  So here is a quick tip that will add a bigger visual clue to your admin level command windows.

Step 1 - Create a batch file using the following and save it to your hard disk.

@echo off
pushd %SystemRoot%\System32
set ADMINTEST=~~4uDude.JHP
:START
MD %ADMINTEST% > NUL 2>&1
if exist %SystemRoot%\System32\%ADMINTEST% GOTO ADMIN
GOTO END
:ADMIN
color 4f
RD %ADMINTEST%
:END
set ADMINTEST=
popd

Basically this batch file is a simple test if you have admin right by trying to create a folder under system32 which a non-admin would not have rights to do.  If successful it will change the background color to red. You could do this a number of different ways, but this gives you the concept.

Step 2 Create a string value called “autorun” under HKEY_LOCAL_MACHINE\Software\Microsoft\Command Processor then point it to the file that you created in Step1.  This value will run the batch file anytime a command prompt is started and change the color for you.

Here is the end result:

Before you know it your admin command prompts will be seeing red.


Posted Oct 11 2006, 04:55 PM by Josh Phillips Did you enjoy this article? If yes, then subscribe to our RSS 2.0 feed

Comments

Mexico501 » Blog Archive » Windows Vista Tip: Adding a Custom Background Color to Admin Command Prompt wrote Mexico501 » Blog Archive » Windows Vista Tip: Adding a Custom Background Color to Admin Command Prompt
on 10-27-2006 3:34 AM
Josh's Windows Weblog wrote Enter To Win - Tricks of the Windows Vista Masters
on 06-10-2007 7:41 AM

Like Long , we too made it into Peter Bruzzese book "Tips of the Windows Vista Masters". Not to brag,

Windows is a registered trademark of Microsoft Corporation.
Powered by Community Server (Non-Commercial Edition), by Telligent Systems Themed By nb development