I have two scenarios in which I want to open multiple URLs that have special characters: -
and ?
. In the first, I have tried escaping occurrences of -
with ^
, but the _sff#
variables all throw errors.
:Item_1
set _base=https://www.~.com/ & _mth1=2019-12 & _mth2=2020-01 & _week=2001 & _sff1=LNI & _sff2=NI & _sff3=NI-final & _sff4=NI-reduced
start brave --incognito %_base%%_mth1%/path-x/NW%_week%-%_sff1%.pdf & ping localhost -n 2 > nul
start brave --incognito %_base%%_mth1%/path-x/NW%_week%-%_sff2%.pdf & ping localhost -n 2 > nul
start brave --incognito %_base%%_mth1%/path-x/NW%_week%-%_sff3%.pdf & ping localhost -n 2 > nul
start brave --incognito %_base%%_mth1%/path-x/NW%_week%-%_sff4%.pdf & ping localhost -n 2 > nul
start brave --incognito %_base%%_mth2%/path-x/NW%_week%-%_sff1%.pdf & ping localhost -n 2 > nul
start brave --incognito %_base%%_mth2%/path-x/NW%_week%-%_sff2%.pdf & ping localhost -n 2 > nul
start brave --incognito %_base%%_mth2%/path-x/NW%_week%-%_sff3%.pdf & ping localhost -n 2 > nul
start brave --incognito %_base%%_mth2%/path-x/NW%_week%-%_sff4%.pdf
goto :EOF
In this scenario, how can I handle the ?
?
:Item_2
set _urls=https://www.~.com/?a=b
set _urls=%urls%;https://www.~.com/
call :Browser
goto :EOF
:Browser
for %%a in (%_urls%) do (
start browser --param %%a & ping localhost -n 2 > nul
)
exit /b