VOGONS


First post, by Ruediger

User metadata
Rank Newbie
Rank
Newbie

When using parameters at batch files at DOSBox, the second "%" character is not correctly replaced by the interpreter.

Example:
If I create a batch file TEST.BAT containing only this line:
echo %1%
and start it from the DOSBox with
TEST one
I get the output "one%".

Running the same batch file at DOS or Windows, the (correct) output is "one".

Reply 1 of 5, by wd

User metadata
Rank DOSBox Author
Rank
DOSBox Author

dosbox version?

Reply 2 of 5, by MiniMax

User metadata
Rank Moderator
Rank
Moderator

Hmmm. I have never used 2 %'s when dealing with positional parameters. Why not just use %1 ?

DOSBox 60 seconds guide | How to ask questions
_________________
Lenovo M58p | Core 2 Quad Q8400 @ 2.66 GHz | Radeon R7 240 | LG HL-DT-ST DVDRAM GH40N | Fedora 32

Reply 3 of 5, by HunterZ

User metadata
Rank l33t++
Rank
l33t++

I thought %foo% was for environment variables (like %PATH%) and %1 was for parameters (not %1%).

Reply 4 of 5, by Ruediger

User metadata
Rank Newbie
Rank
Newbie

My DOSBox Version is 0.73

Reply 5 of 5, by wd

User metadata
Rank DOSBox Author
Rank
DOSBox Author

Why not just use %1 ?