VOGONS


First post, by quazirfan

User metadata
Rank Newbie
Rank
Newbie

Hello,

I am trying to write a batch script that loops over all file in the current directory and performs some operation on thatm, and I want to use for command to do the looping.

But DosBox says for is an illegal command. After a quick googling I found out, for is not a supported command in DosBox.

Question is, what are the alternate options for me to loop in a batch file in Dosbox?

Thank you.

Reply 2 of 14, by Osprey

User metadata
Rank Member
Rank
Member

I was about to point you to my thread, but you've already found it. I'm glad that it helped someone out. I wasn't sure because no one ever replied to it 😀.

Reply 3 of 14, by Wengier

User metadata
Rank Member
Rank
Member

And for your information, recent versions of DOSBox SVN-lfn (like vDosPlus's internal shell) has a built-in FOR command. An example:

for %f in (*.iso *.cue) do set cdlist=%cdlist% %f

vDosPlus by default uses the 4DOS 8.00 shell, so advanced options of the FOR command like /F are natively supported by this shell. For DOSBox you have to call 4DOS externally instead in order to support such options.

Wengier

Reply 4 of 14, by Silanda

User metadata
Rank Member
Rank
Member

Personally, I'd like to see this command implemented in DosBox. Before anybody says, "Dosbox is only for games", here's an example of a game that needs better implementation of batch commands: Super-VGA Harrier. While the game works fine in DosBox, the installer is a batch file, containing For, and does not.

Reply 5 of 14, by Wengier

User metadata
Rank Member
Rank
Member

Since this command is already implemented in DOSBox SVN-lfn, if only DOSBox developers want to add it to the official build...

Reply 7 of 14, by Wengier

User metadata
Rank Member
Rank
Member
collector wrote:
Wengier wrote:

Since this command is already implemented in DOSBox SVN-lfn, if only DOSBox developers want to add it to the official build...

I wouldn't expect that. No or next no games require LFN.

I was only talking about the FOR command in this version though. Even though this build has built-in LFN support (obviously), the implementation of the FOR command (and many additional features like its mouse copy/paste support) is not dependent on the LFN features...

Wengier

Last edited by Wengier on 2017-09-26, 01:28. Edited 1 time in total.

Reply 8 of 14, by Osprey

User metadata
Rank Member
Rank
Member
Wengier wrote:

And for your information, recent versions of DOSBox SVN-lfn (like vDosPlus's internal shell) has a built-in FOR command.

I didn't realize that. Thanks for the info and the work to include the command.

Reply 9 of 14, by Azarien

User metadata
Rank Oldbie
Rank
Oldbie
collector wrote:

I wouldn't expect that. No or next no games require LFN.

But having LFN support in the shell would be very useful to quickly cd between directories on disk.
Having to deal with all those progra~1 is so annoying.

I aggree that LFN API implementation is not needed for games.

Reply 10 of 14, by collector

User metadata
Rank l33t
Rank
l33t
Azarien wrote:

But having LFN support in the shell would be very useful to quickly cd between directories on disk.
Having to deal with all those progra~1 is so annoying.

Everything under a mounted folder should conform to the DOS 8.3 filename convention. If you really need LFN support you should probably be using something other than DOSBox, like vDosPlus.

The Sierra Help Pages -- New Sierra Game Installers -- Sierra Game Patches -- New Non-Sierra Game Installers

Reply 11 of 14, by Azarien

User metadata
Rank Oldbie
Rank
Oldbie
collector wrote:

Everything under a mounted folder should conform to the DOS 8.3 filename convention

"Should"... but why? It surely doesn't have to under Windows 9x.

And more often than not, I'm mounting the whole disk, just out of convenience.

Reply 12 of 14, by JosSchaars

User metadata
Rank Newbie
Rank
Newbie

No LFN in MS-DOS 5.x (DOSBox), no games or applications depending on LFN.
You could instead start Windows CMD and useful quickly CD all day long.

Reply 13 of 14, by IIGS_User

User metadata
Rank Oldbie
Rank
Oldbie
Azarien wrote:

And more often than not, I'm mounting the whole disk, just out of convenience.

Please run

FORMAT C: 😈

Klimawandel.

Reply 14 of 14, by Wengier

User metadata
Rank Member
Rank
Member

This thread is about the FOR command. It is better to discuss elsewhere about other features like LFN support...