VOGONS

Common searches


First post, by qbeer

User metadata
Rank Newbie
Rank
Newbie

Hello,
this is my first shot 😀

In my QB45 program i uses "SHELL DIR>REPORT.TXT" often.
Then my program read REPORT.TXT to see situation there.
But DIR report of DOSBox is so different that my program isn't able to understand it.
Until now I try ordinal DOS (5, 6.22), DOS in XP, FreeDos and everywhere this worked OK.

I have idea what to do to get this working.
1) Do changes in my program
2) Make my own DIR command
3) Replace command.com somehow...
Every solution has his positive and negative consequences.

So, question for expirienced users is how to get "USUAL" DIR report on DOSBox at simplest way to get my program to work properly?

Reply 1 of 15, by ripsaw8080

User metadata
Rank DOSBox Author
Rank
DOSBox Author

One option described here: Output from dir command

However, you may need an SVN build of DOSBox to get a correct DIR listing when using COMMAND.COM from MS-DOS, so figure that into your decision of which option is easiest.

Reply 2 of 15, by qbeer

User metadata
Rank Newbie
Rank
Newbie

Interesting!

For some reason I can't get it to work, DOSBox command.com is still the boss.
I copy command.com from Win XP (system32 directory) to my c:\
Here is how my [autoexec section] looks like.

[autoexec]
# Lines in this section will be run at startup.
# You can put your MOUNT lines here.

@Echo off
mount c c:\
c:
SET COMSPEC=C:\COMMAND.COM
cd mydir
path=%path%;c:\mydir

Any obvious reason why this replacement wouldn't work?

Reply 3 of 15, by ripsaw8080

User metadata
Rank DOSBox Author
Rank
DOSBox Author

The COMMAND.COM from Windows won't work, you need one from MS-DOS 5 or 6. You can also try other shells like the one from FreeDOS, or 4DOS, but the one from MS-DOS is mostly likely to have the specific DIR format you need.

Also, it's not a good idea to mount the root of your real C: drive in DOSBox. Instead, mount a directory as the emulated C: drive and place COMMAND.COM in that directory. e.g. MOUNT C C:\DOS

Reply 4 of 15, by qbeer

User metadata
Rank Newbie
Rank
Newbie

OK, I will try to configure situation that way.
Also I will try various versions of command.com.
As for now I smell that FreeDOS command will be good. But I have to see.

I will squeak further if problem persist.

Thanks for a great help!

Reply 5 of 15, by Jorpho

User metadata
Rank l33t++
Rank
l33t++

Whatever you choose, I'm pretty sure you just need to run COMMAND.COM (or 4DOS.COM or whatever) directly; you don't need to mess with COMSPEC.

The major downside to using 4DOS or any other kind of command.com is that I don't think you will be able to use DOSBox commands like "mount" until you exit.

Reply 7 of 15, by qbeer

User metadata
Rank Newbie
Rank
Newbie

Hm, hm... As for now I keep my dir configuration (because of my program) like C=C:\. Then I try command.com from FreeDOS and MS-DOS 6.22 and didn't get it to work as expected.
For experiment I copy also a program "TREE" and after VER SET 6 22 it works.
Then I can run new c:\command.com but it report all file sizes as zero and have prompt like c>.
When I EXIT original command.com from DOSBox appears.

Just for curiosity.
Which is the reason for so special DIR instead of usual (traditional) one?
From my point of view it would be the best to use original DOSBox system instead of messing arround with parts of other OS-es.

As I can see in short time QB45 works very well on DOSBox in building libs, linking, compiling, using interrupts etc, etc...

Reply 8 of 15, by ripsaw8080

User metadata
Rank DOSBox Author
Rank
DOSBox Author
qbeer wrote:

after VER SET 6 22 it works. Then I can run new c:\command.com but it report all file sizes as zero and have prompt like c>.

DOSBox reports DOS version 5.0 by default, so you don't have to change the reported version with programs from MS-DOS 5. Also, remember that the PROMPT environment variable defines what the prompt looks like in MS-DOS; e.g. SET PROMPT=$P$G

As I mentioned in an earlier comment, you will probably need an SVN build of DOSBox for the DIR command from MS-DOS to work correctly.

qbeer wrote:

Which is the reason for so special DIR instead of usual (traditional) one?

I don't think it was intended to be special, it was just not seen as important to exactly copy the formatting of the DIR command from MS-DOS. After all, parsing the redirected output of the DIR command is crude; DOS has function calls for working with directory info that well-written programs use.

Reply 9 of 15, by Jorpho

User metadata
Rank l33t++
Rank
l33t++
ripsaw8080 wrote:

Pretty sure you'll need to "mess with" COMSPEC for the SHELL command in QuickBASIC.

Whoops! Forgot about that. Right you are.

qbeer wrote:

As I can see in short time QB45 works very well on DOSBox in building libs, linking, compiling, using interrupts etc, etc...

If you want to run QuickBasic programs, you should consider using QB64 or FreeBASIC instead of DOSBox. DOSBox is really only intended for running games presently.

Reply 10 of 15, by qbeer

User metadata
Rank Newbie
Rank
Newbie

There are situation where well writting programs are not possible to do because you haven't tools for do this. In that case shelling from QuickBasic may be OK (for copy/move/conditionally delete files for example...).
I am not only one which find where problem is with that report and there are many more of them which simply says "this don't work" or "DOSBox is still not good enough" and then goes away.

If I would do OS which "reports DOS version 5.0" then I would take a care that final appearance of every function will be into STANDARD which DOS 5 defines. Especially because I have a feeling that doing this after all other work is done - costs "nothing". But OK, that may be a point of view.

I would like to try SVN build of DOSBox in order to get wanted DIR listing.
Can you give me a link on exact what I have to download and install?

Reply 11 of 15, by ripsaw8080

User metadata
Rank DOSBox Author
Rank
DOSBox Author
qbeer wrote:

not possible to do because you haven't tools

QB is rather limited in its built-in tools, but there is always the CALL command. You can find alternatives to shelling out here.

qbeer wrote:

there are many more of them which simply says "this don't work" or "DOSBox is still not good enough" and then goes away.

These persons are (or should be) reminded that DOSBox is intended to run DOS games. If games were in the habit of shelling out to run DIR commands then it's a safe bet that more attention would have been paid to making the formatting a more exact match for MS-DOS.

qbeer wrote:

I would like to try SVN build of DOSBox in order to get wanted DIR listing.
Can you give me a link on exact what I have to download and install?

Info about SVN builds is here. I recommend a vanilla build because it's more likely to have the specific fix needed.

Reply 12 of 15, by qbeer

User metadata
Rank Newbie
Rank
Newbie

Yes I install SVN build succesfully but again can't replace command.com by provided way. So I think it woud be best to do some work to replace critical part of program with one which will bw OK for all DOS versions so I can keep original DOSBox configuration.
I don't play games but for now DOSBox looks great for my job too.

Thanks for helping...

Reply 14 of 15, by qbeer

User metadata
Rank Newbie
Rank
Newbie

Maybe because my c is still in c:\ what I can't change before changes in my program.
After replacing to SVN version I have report in "DOS" that this is SVN version.
Also nev conf file is created where I wrote same [autoexec] section as before.
Now I thing that it would be best for not doing this anymore but to do changes in program. I would probbably do my DIR program in QB with using INTERRUPTX routines and use it instead of those from command.com.
I still didn't find any other "mistake" in DOSBox to use it with my program but find some advantages like biggest possible memory resources...

When we are here...
In DOS when you do DIR /S /P in directory with much entries it is possible to do Ctrl+C to terminate/break operation.
How I can break such operation in DOSBox?

Reply 15 of 15, by ripsaw8080

User metadata
Rank DOSBox Author
Rank
DOSBox Author

When you mount a folder in DOSBox (e.g. MOUNT C C:\DOS) programs running in DOSBox see that folder as the root. C:\DOS looks like C:\ to programs running inside the emulation. Mounting the real root of your C: drive is hazardous. For example, if you were to install Windows 3.x in DOSBox it would by default be placed into C:\WINDOWS, and imagine the potential for disaster when that's where the host Windows is installed.