home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Power-Programmierung
/
CD1.mdf
/
magazine
/
pcmagazi
/
1990
/
11
/
se.bat
< prev
next >
Wrap
DOS Batch File
|
1990-05-09
|
4KB
|
126 lines
se.bat
ECHO off
SET file=%0d.bat
SET return=%file% %0
IF NOT EXIST %dir%\%file% GOTO reset
:next
SET return=GOTO old
IF %1!==! GOTO help
IF %1==r GOTO reset
IF %1==R GOTO reset
IF %1==s GOTO show
IF %1==S GOTO show
IF %2!==! GOTO help
IF %3!==! GOTO help
IF %1==/h SET color=chelp
IF %1==/H SET color=chelp
IF %1==/p SET color=cprom
IF %1==/P SET color=cprom
IF %1==/l SET color=cline
IF %1==/L SET color=cline
IF %1==/s SET color=reset
IF %1==/S SET color=reset
REM ---- Change one color choice. ----
REM Make a copy of SED.BAT, omitting the OLD choice for that color.
TYPE %dir%\%file%|FIND/V "%color%"|FIND/V "%%1">%ram%\%file%
REM Create a file with a line that sets the NEW choice.
ECHO SET %color%= 1B[%2;%3m>%ram%\temp
ECHO %%1>>%ram%\temp
REM Copy the changed file back to SED.BAT
COPY %ram%\%file%+%ram%\temp %dir%>NUL
del %ram%\%file%
SET end=%file%
:old
REM Grab another three parameters from the command line
SHIFT
SHIFT
SHIFT
IF %3!==! GOTO end
GOTO next
:reset
REM Re-create the original version of SED.BAT by...
REM ECHOing each of its lines to a file.
ECHO ECHO OFF>%dir%\%file%
rem Change the next line to match your hard drive
ECHO SET DIR=D:\bat>>%dir%\%file%
rem Change the next line to match your ram disk or hard drive
ECHO SET RAM=C:>>%dir%\%file%
ECHO SET el= 1B[K>>%dir%\%file%
ECHO SET top= 1B[H>>%dir%\%file%
ECHO SET up8= 1B[8A>>%dir%\%file%
ECHO SET up4= 1B[4A>>%dir%\%file%
ECHO SET up2= 1B[2A>>%dir%\%file%
ECHO SET up1= 1B[1A>>%dir%\%file%
ECHO SET hide= 1B[8m>>%dir%\%file%
ECHO SET chelp= 1B[0m>>%dir%\%file%
ECHO SET cprom= 1B[0m>>%dir%\%file%
ECHO SET cline= 1B[0m>>%dir%\%file%
ECHO SET reset= 1B[0m>>%dir%\%file%
ECHO %%1>>%dir%\%file%
SET end=sed
%return%
:show
REM Show the environment, but omit the ANSI variables.
CLS
ECHO %chelp%%top%
ECHO The Current Environment is:
SET |find/v "["
ECHO %reset%
SET end=
GOTO end
:help
SET fix= 1B[A 1B[24C
ECHO %chelp%%up8%%up8%%up8%%up1%
ECHO %up1%┌───────────────────────────────────────────────┐
ECHO │ Color SET Routine for Batch Files │%cline%
ECHO │───────────────────────────────────────────────│%chelp%
ECHO │ SED will setup last SET of color values │
ECHO │ SE R will ReSET the colors to the default │
ECHO │ SE S will Show current Environment │
ECHO │ SE /H ## ## sets the help menu color │
ECHO │ SE /P ## ## sets the prompt colors │
ECHO │ SE /L ## ## sets the single line colors │
ECHO │ SE /S ## ## sets the screen colors │
ECHO │─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────│
ECHO │ 1B[30;40m30 40 1B[31;40m│31 40 1B[32;40m│32 40 1B[33;40m│33 40
ECHO %fix% 1B[34;40m│34 40 1B[35;40m│35 40 1B[36;40m│36 40 1B[37;40m│
37 40%chelp%│
ECHO │ 1B[30;41m30 41 1B[31;41m│31 41 1B[32;41m│32 41 1B[33;41m│33 41
ECHO %fix% 1B[34;41m│34 41 1B[35;41m│35 41 1B[36;41m│36 41 1B[37;41m│
37 41%chelp%│
ECHO │ 1B[30;42m30 42 1B[31;42m│31 42 1B[32;42m│32 42 1B[33;42m│33 42
ECHO %fix% 1B[34;42m│34 42 1B[35;42m│35 42 1B[36;42m│36 42 1B[37;42m│
37 42%chelp%│
ECHO │ 1B[30;43m30 43 1B[31;43m│31 43 1B[32;43m│32 43 1B[33;43m│33 43
ECHO %fix% 1B[34;43m│34 43 1B[35;43m│35 43 1B[36;43m│36 43 1B[37;43m│
37 43%chelp%│
ECHO │ 1B[30;44m30 44 1B[31;44m│31 44 1B[32;44m│32 44 1B[33;44m│33 44
ECHO %fix% 1B[34;44m│34 44 1B[35;44m│35 44 1B[36;44m│36 44 1B[37;44m│
37 44%chelp%│
ECHO │ 1B[30;45m30 45 1B[31;45m│31 45 1B[32;45m│32 45 1B[33;45m│33 45
ECHO %fix% 1B[34;45m│34 45 1B[35;45m│35 45 1B[36;45m│36 45 1B[37;45m│
37 45%chelp%│
ECHO │ 1B[30;46m30 46 1B[31;46m│31 46 1B[32;46m│32 46 1B[33;46m│33 46
ECHO %fix% 1B[34;46m│34 46 1B[35;46m│35 46 1B[36;46m│36 46 1B[37;46m│
37 46%chelp%│
ECHO │ 1B[30;47m30 47 1B[31;47m│31 47 1B[32;47m│32 47 1B[33;47m│33 47
ECHO %fix% 1B[34;47m│34 47 1B[35;47m│35 47 1B[36;47m│36 47 1B[37;47m│
37 47%chelp%│
ECHO └─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┘
SET fix=
ECHO %reset%%up1%
SET end=
:end
SET return=
SET color=
%end%