I'm trying to program batch script in dosbox, but there is no some commands.
For example, if I execute this code:
set var=helloworld
echo %var:~1,5%
I'll get empty line.
Also I can't execute FOR
command. It says: 'Illegal command FOR'
I'm trying to program batch script in dosbox, but there is no some commands.
For example, if I execute this code:
set var=helloworld
echo %var:~1,5%
I'll get empty line.
Also I can't execute FOR
command. It says: 'Illegal command FOR'
command.com
-like command processor included with DosBox
is not fully compatible with command syntax of MS-DOS command.com
or especially windows NT's cmd.exe
command processors.
See this page for commands available to DosBox and their syntax. They may be similar but not the same to MS-DOS ones.
Your options are:
use a batch file that runs outside dosbox
for anything that does not need to be inside it
copy and run command.com
from a real MS-DOS or other DOS. You can get one from an image of a DOS boot floppy (or Windows 95, 98 or ME) which should be plentiful in the internet. Then refer to command-line manual for that DOS version. You will lose access to DosBox-specific commands inside it and it may try to needlessly hog the CPU as almost any other DOS program.
write a program in any programming language that can be executed in DOS like C (free C compilers for DOS) and call it from DosBox. Some of the compilers are made free and available for download.