Vadim Rapp
asked on
Batch file: how to call <label> with parameter with & inside?
I have this batch:
How to get it to work so parameter %1 gets the actual string ab&cd ?
set p=abcde
call :mysub %p%
exit /b
:mysub
echo %1
and it works as expected. But if instead of abcde I have a string with & inside, set p=ab&de
call :mysub %p%
exit /b
:mysub
echo %1
it does not work, as I understand because & is interpreted as escape character. I tried to put various numbers of ^ before & in line 1, but nothing works. How to get it to work so parameter %1 gets the actual string ab&cd ?
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Open in new window