Difference between revisions of "Command Line"

From DOSBoxWiki
Jump to navigationJump to search
(link)
 
(10 intermediate revisions by 7 users not shown)
Line 1: Line 1:
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)
+
:''This article is about Command Line inside DOSBox. For DOSBox Command Line Parameters, see [[Usage]]''.
<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.
 
  
 
+
The command line inside DOSBox is very similar to the one of a real DOS system, such as displaying the command-line prompt "C:\>" and waiting for user input. Nevertheless, the default initial drive of DOSBox is [[ZDrive|Z:]], a Virtual Internal Drive, instead of A: or C: when booting from a real DOS system. In either case the user can type a DOS command such as "DIR" which will be executed after the ENTER key is typed. After that the command-line prompt will be shown again to wait for another user input. Please see [[commands]] for a list of supported commands in DOSBox.
Please note that you will rarely encounter this problem (dosbox parses %11 as then eleventh parameter)
 
I will repair this in the next version of dosbox
 

Latest revision as of 15:53, 24 April 2016

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

The command line inside DOSBox is very similar to the one of a real DOS system, such as displaying the command-line prompt "C:\>" and waiting for user input. Nevertheless, the default initial drive of DOSBox is Z:, a Virtual Internal Drive, instead of A: or C: when booting from a real DOS system. In either case the user can type a DOS command such as "DIR" which will be executed after the ENTER key is typed. After that the command-line prompt will be shown again to wait for another user input. Please see commands for a list of supported commands in DOSBox.