Scripts, Windows

Command Prompt with Random Color on Startup

Written in 2012 for the Windows versions of the time. Check that the tool or steps still suit your environment before using them.

Prerequisites

  • Administrator rights (writes to HKLM and System32)

Add REG_SZ to HKLM\SOFTWARE\Microsoft\Command Processor with name AutoRun and value of RndColor.bat
Create file RndColor.bat in %WINDIR%\System32

@Echo Off
Echo Loading...

SET rnd=%random%

IF %rnd% LSS 4681 GOTO 1
IF %rnd% LSS 9362 GOTO 2
IF %rnd% LSS 14043 GOTO 3
IF %rnd% LSS 18724 GOTO 4
IF %rnd% LSS 23405 GOTO 5
IF %rnd% LSS 28086 GOTO 6
IF %rnd% LSS 32767 GOTO 7

Goto END

:1
Color 1F
Goto END

:2
Color 20
Goto END

:3
Color 30
Goto END

:4
Color 4E
Goto END

:5
Color 5F
Goto END

:6
Color 80
Goto END

:7
Color 4F
Goto END

:END
CLS

Posted on

No comments yet

Comments are moderated and appear once approved.