You may use my auxiliary .EXE commands to achieve what you want in two ways:
The easiest way is via TextColor.exe command that allows to set the color used by posterior DOS commands. For example:
Code: Select all
set /P "=Paste Your RTMP Url Here..Then Press [ENTER]: " <NUL
rem Set text color as black over white (reverse video):
TextColor 70
rem Read the input line in reverse video:
set /p "url="
rem Reset text color to original:
TextColor 07
pause
However, the input line will appear in color
until the text is entered, so I think this is not what you want. Besides, TextColor.exe program will NOT work in certain old computers (like the mine

).
What we really want is that the field where the input line is read appear in reverse video
before the text be typed. However, in order for this to work we must define the number of characters that will appear in reverse video ("field wide") and, of course, the input routine must limit the maximum input line lenght to that wide.
I previously wrote a ReadLine.bat example program that simulate SET /P command this way: it read characters until Enter key is pressed and delete the last character read with BackSpace key. I modified such routine into ReadField.bat program that achieve the previous process and also allows to optionally give an
initial value that will appear in the field before the user start typing. Here it is:
Code: Select all
@echo off
rem Read a value in a visually delimited field
rem Antonio Perez Ayala
set Bell=7
set BackSpace=8
set Enter=13
set Space=32
:ReadField var="prompt" /bf wide ["initial value"]
rem %1 %2 %3 %4 %5
setlocal EnableDelayedExpansion
Show %2
CursorPos
set initPos=%errorlevel%
ColorShow %3 %Space%*%4
CursorPos %initPos%
set len=0
if "%~5" equ "" (
set %1=
) else (
ColorShow %3 %5
set "%1=%~5"
for /L %%i in (0,1,80) do if "!%1:~%%i,1!" neq "" set /A len+=1
)
:nextKey
GetKey
set key=%errorlevel%
if %key% geq %Space% (
rem Ascii character: insert it
if %len% lss %4 (
ColorShow %3 %key%
for /F "delims=" %%a in ('Show %key%') do set "%1=!%1!%%a"
set /A len+=1
) else (
rem Wide exceeded
Show %Bell%
)
) else if %key% equ %BackSpace% (
rem Backspace: delete last character
if defined %1 (
ColorShow %3 %BackSpace% %Space% %BackSpace%
set "%1=!%1:~0,-1!"
set /A len-=1
) else (
rem Empty value
Show %Bell%
)
)
if %key% neq %Enter% goto nextKey
echo/
for /F "delims=" %%a in ("!%1!") do endlocal & set %1=%%a
exit /B
For example, if your RTMP Url value can have 40 characters maximum:
Code: Select all
call :ReadField url="Paste Your RTMP Url Here..Then Press [ENTER]: " /70 40
Previous Batch subroutine use these auxiliary programs: 2-Show.exe, 3-GetKey.exe, 6-CursorPos.exe and 12-ColorShow.exe; you may copy all they from
this post.
NOTE: My previous version of ColorShow.exe program have a bug so it not correctly show control characters (like BS, CR and LF). I fixed it and modified the former ColorShow.exe.hex file 5 minutes before I posted this reply. If you want to use ReadField.bat routine, please download ColorShow.exe.hex file again and re-create ColorShow.exe.
Antonio