In a batch file, is there any way to get the raw arguments or command? For example, given the following batch file:
echo "%1"
And then running:
my-file.bat ^1.1
I would like it to output ^1.1
, but ^
is a special character—escape character—so it is evaluated and %1
contains 1.1
.
It is possible to fix this by escaping the caret when inputting the command (ex. my-file.bat ^^1.1
), but this is not desired in my situation as I'm building a cross platform tool that also has a shell implementation (where providing ^1.1
works).
So I am wondering either:
- Is there a way to get the raw unevaluated argument text of "^1.1"?
- Or is there a way to get the raw command string or perhaps the last executed command text? I could then take this and do my own parsing.
Thanks!