VOGONS


First post, by robby

User metadata
Rank Newbie
Rank
Newbie

Hi all!

I am trying to run a program of my own (written and compiled in Quick Basic) in the DOSBOX environment. In my program there is a "shell" call to DOS invoking the DIR commad to save a directory image to a file: however, I want to use the /o: switch to sort the directory in a specific way, and this switch is not supported in the actual DOS version of DOSBOX (a VER command reports "The DOS version in 5.0"). As a consequence, what is saved to file is not the directory image but the error message: "Invalid parameter /o:..." and then the program crashes.
Can the problem be fixed in some way, e.g. upgrading the DOS version to 6+ ? Or is it a choice of DOSBOX authors?

Thanks for any help.

Reply 1 of 4, by ykhwong

User metadata
Rank Oldbie
Rank
Oldbie

The version number is fake but reserved for the compatibility. It means that DOSBox will work like MS-DOS 5.x. DOSBox provides some simple version of commands, part of which do not allow wildcard or support few switches.
Try to boot a floppy image which includes MS-DOS or the like.

Reply 2 of 4, by MiniMax

User metadata
Rank Moderator
Rank
Moderator

"or the like" means something like FreeDOS.

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 4, by fxm

User metadata
Rank Newbie
Rank
Newbie
MiniMax wrote:

"or the like" means something like FreeDOS.

May I suggest the Berkeley utilities [unix ports for 16-bit DOS]? Now free and in the public domain, they can be installed one tiny independent module at a time.
A complete list is here
http://reimagery.com/fsfd/unix.htm#unixutils
[about half way down].
It isn't too difficult to - er - emulate DOS commands missing from DOSBox by wrapping unix commands in a bat file. For example: 'ls' can get the effect of "dir /o.."; 'grep' implements "find"; 'more' and 'sort' do the obvious; and so on.
Those comfortable with unix shell programming may get an idea of the power of what one can get for free by looking at this command

awk -f txt.awk `ls -r1 [0-9][0-9][0-9][0-9][0-9][0-9]E*.TXT` >LIST.HTM

which runs beautifully in DOSBox [the two `s are backquotes].

Note: I realize that I am resurrecting a very old thread, but "dir" and "more" are such common terms that I had great difficulty trying to find any thread that discusses issues like this, let alone a more current one.

Also: admittedly the very limited support for | (pipe) in DOSBox does make assembling complex procedures a bit tedious