:: :: Drop files to this cmd to open with Firefox via jar: protocol :: :: Version: 1.0.5 :: Author: Danny Lin :: License: MIT :: @echo off chcp 65001 set CMD="" "firefox" :loop set "F=%~1" setlocal EnableDelayedExpansion :: "^!" escapes "!" in double quotes (normally "^^!" escapes "!") set "U=jar:file:///!F!^!/index.html" :: replace "%" with "%25" ("%%" escapes "%") set "U=!U:%%=%%25!" :: replace "#" with "%23" ("%%" escapes "%") set "U=!U:#=%%23!" start !CMD! "!U!" endlocal shift if not "%~1" == "" goto loop