VOGONS


First post, by proguru

User metadata
Rank Newbie
Rank
Newbie

Hi. I'm looking for help using batch scripting in DOSBox.

I have an old DOS program that does data conversion on files. I have used a batch script to run the conversion command for all files in a folder:

FOR %%i in (*.DAT) DO PROGRAM.EXE %%i %%i.NEW

Now, when we have finally moved to Windows 7 (64bit) and old 16bit DOS programs don't work anymore, I thought that DOSBox could be the savior. Unfortunately, it seems DOSBox doesn't understand most of the DOS commands, e.g. FOR.

My old DOS program works in DOSBox, but how can I run a script to do something to all files?

Reply 1 of 4, by Dominus

User metadata
Rank DOSBox Moderator
Rank
DOSBox Moderator

Not everything that worked in the Windows command prompt, worked in pure Dos. Someone else can surely be more specific... 😉

Windows 3.1x guide for DOSBox
60 seconds guide to DOSBox
DOSBox SVN snapshot for macOS (10.4-11.x ppc/intel 32/64bit) notarized for gatekeeper

Reply 2 of 4, by ripsaw8080

User metadata
Rank DOSBox Author
Rank
DOSBox Author

The FOR command is typically not needed by games or game installers, so it's not implemented in the DOSBox shell. However, you can run the 4DOS shell in DOSBox to have all the familiar DOS commands, some with enhanced features, and even a few new commands.

Reply 3 of 4, by proguru

User metadata
Rank Newbie
Rank
Newbie
ripsaw8080 wrote:

The FOR command is typically not needed by games or game installers, so it's not implemented in the DOSBox shell. However, you can run the 4DOS shell in DOSBox to have all the familiar DOS commands, some with enhanced features, and even a few new commands.

Thanks. This solved the the problem. 4DOS is really a great shell. I also found that COMMAND.COM from MS-DOS 5.0 can be run on DOSBox. It definitely has all the original DOS commands and syntax.

Reply 4 of 4, by ripsaw8080

User metadata
Rank DOSBox Author
Rank
DOSBox Author

I don't recommend running COMMAND.COM from MS-DOS in DOSBox (unless you're booting MS-DOS) because it uses internal DOS structures that are not implemented in DOSBox's built-in DOS. For example, look at the date stamps and file sizes on DIR command listings.