Difference between revisions of "Command Line"

From DOSBoxWiki
Jump to navigationJump to search
m (removed <br> tag)
Line 1: Line 1:
 
:''This article is about Command Line inside DOSBox. For DOSBox Command Line Parameters, see [[Usage]]''.
 
:''This article is about Command Line inside DOSBox. For DOSBox Command Line Parameters, see [[Usage]]''.
 
 
Passing arguments to BAT file does not work exactly the same in DOSBox as is does in other environments (like Win98).  Consider the following file (TEST.BAT)
 
<code><pre>echo -%1- 0%10 1%11 2%12</pre></code>
 
On Win98, '''TEST.BAT 99''' produces:
 
<code><pre>-99- 0990 1991 2992</pre></code>
 
Whereas DOSbox 0.70 produces:
 
<code><pre>-99- 0990 1 2</pre></code>
 
A work-around is to change TEST.BAT to:
 
<code><pre>SET X=%1
 
echo -%X%- 0%X%0 1%X%1 2%X%2</pre></code>
 
This coding style has the added benefit of allowing order of arguments to be changed at some future time without major impact on your script.
 
 
== NOTE ==
 
Please note that you will rarely encounter this problem (dosbox parses %11 as then eleventh parameter) This has been repaired in the SVN of dosbox. Please submit a bug report next time.
 

Revision as of 12:32, 17 December 2011

This article is about Command Line inside DOSBox. For DOSBox Command Line Parameters, see Usage.