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
