Improved command line completion for cmd.exe
RLoadDll.exe
injects the RadLine.dll
into cmd.exe
process.
On startup the RadLine.dll
replaces the ReadConsole
function with its own. This allows it to intercept the command line completion behaviour.
This was the main reason for creating this utility. Completion is looked up using the lua script RadLine.lua.
The function FindPotential
is called with the current command line and returns an array of potential matches.
The matches are then listed under the current line.
To enable:
set RADLINE_AUTO_TERMINATE_BATCH=1
This setting will auto respond y
to the Terminate batch job (Y/N)?
prompt.
The ~
at the start of an argument is expanded to %USERPROFILE%
.
The contents of the environment variable RADLINE_POST
are appended to the current command.
For example:
set RADLINE_POST=echo Error: ^%ERRORLEVEL^%
__PID__
will show the process id of the cmd process.
PROMPT
environment variables in the prompt variable will also be expanded.
set foo=%(cmd /c echo bar)%
the command in the brackets will expand to the output of the command.
To install, download the zip and decompress to %APPDATA%\Radsoft\RadLine
Add the following lines to your cmd startup script:
set RADLINEDIR=%APPDATA%\Radsoft\RadLine
"%RADLINEDIR%\RLoadDll.exe" /d - "%RADLINEDIR%\RadLine.dll"