I need to pass a single (quoted) parameter to an exe file with a single leading caret.
I tried this:
@echo off
setlocal
call :RunQuery "^one two"
goto wrapup
:RunQuery
call test.exe %1
:wrapup
This results in
"^^one two"
But I need it to be
"^one two"
I tried
%~1, "%~1" and ^"%~1^"
without success.
The last one appears to work with an echo but not when used with the exe file:
call test.exe ^"%~1^"
In this case test.exe still seems to get two carets.