I often have to decrypt encrypted filenames and as I'm lazy I wrote a quick'n'dirty batch where I only need to input the single encrypted strings one after another instead of editing the CL over and over.
The batch can be terminated by [CTRL]-[C], [ENTER] (or input of any invalid string) or closing the cmd window.
Tested on several Win10 21H2.
Hope it's of help to anyone else too: rcd.bat
@echo OFF
REM usage: rcd remote:
REM if no remote is given display help
if [%1%]==[] (
echo usage: rcd remote:
goto END
)
REM if remote has no trailing ":" report error
set remote=%1%
echo.%remote%| findstr /e : >NUL
if ERRORLEVEL 1 (
echo remote must end with ":"
set remote=
goto END
)
REM if remote doesn't exist report error
rclone listremotes | C:\Windows\System32\find.exe "%1%" >NUL
if ERRORLEVEL 1 (
echo remote not found
goto END
)
:START
REM wait for input
set /p "cryptedstring=encrypted string: "
REM prepend a text so crypttext and plaintext start in the same column
<NUL set /p="plaintext string: "
REM decrypt string
rclone backend decode %1% %cryptedstring%
if ERRORLEVEL 1 goto END
echo.
REM clean up (delete variables)
set cryptedstring=
REM restart for next string
goto START
:END