For or alternate of For command

General information and assistance with DOSBox.

For or alternate of For command

Postby quazirfan » 2017-9-24 @ 05:08

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.
quazirfan
Newbie
 
Posts: 2
Joined: 2017-9-24 @ 04:15

Re: For or alternate of For command

Postby quazirfan » 2017-9-24 @ 05:21

I've found solution to my problem in this thread : HOW-TO Use the FOR command (+ other missing DOS commands) & automate ISO mounting.

Thanks guys.
quazirfan
Newbie
 
Posts: 2
Joined: 2017-9-24 @ 04:15

Re: For or alternate of For command

Postby Osprey » 2017-9-24 @ 20:07

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 :).
Osprey
Member
 
Posts: 175
Joined: 2017-7-27 @ 21:32

Re: For or alternate of For command

Postby Wengier » 2017-9-25 @ 02:24

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
Wengier
Member
 
Posts: 110
Joined: 2014-9-03 @ 19:56

Re: For or alternate of For command

Postby Silanda » 2017-9-25 @ 15:36

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.
Silanda
Member
 
Posts: 140
Joined: 2005-9-08 @ 01:24

Re: For or alternate of For command

Postby Wengier » 2017-9-25 @ 17:28

Since this command is already implemented in DOSBox SVN-lfn, if only DOSBox developers want to add it to the official build...
Wengier
Member
 
Posts: 110
Joined: 2014-9-03 @ 19:56

Re: For or alternate of For command

Postby collector » 2017-9-25 @ 23:37

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.
User avatar
collector
l33t
 
Posts: 3987
Joined: 2003-1-15 @ 10:39

Re: For or alternate of For command

Postby Wengier » 2017-9-26 @ 01:21

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-9-26 @ 01:28, edited 1 time in total.
Wengier
Member
 
Posts: 110
Joined: 2014-9-03 @ 19:56

Re: For or alternate of For command

Postby Osprey » 2017-9-26 @ 01:24

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.
Osprey
Member
 
Posts: 175
Joined: 2017-7-27 @ 21:32

Re: For or alternate of For command

Postby Azarien » 2017-9-26 @ 15:15

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.
Azarien
Member
 
Posts: 361
Joined: 2015-5-14 @ 07:14

Re: For or alternate of For command

Postby collector » 2017-9-26 @ 23:29

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.
User avatar
collector
l33t
 
Posts: 3987
Joined: 2003-1-15 @ 10:39

Re: For or alternate of For command

Postby Azarien » 2017-9-27 @ 18:56

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.
Azarien
Member
 
Posts: 361
Joined: 2015-5-14 @ 07:14

Re: For or alternate of For command

Postby JosSchaars » 2017-9-27 @ 20:35

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.
JosSchaars
Newbie
 
Posts: 35
Joined: 2014-1-26 @ 21:58

Re: For or alternate of For command

Postby IIGS_User » 2017-9-28 @ 08:56

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

Please run

FORMAT C: :evil:
Klimawandel.
User avatar
IIGS_User
Oldbie
 
Posts: 874
Joined: 2007-3-14 @ 19:59
Location: native_lang=ger

Re: For or alternate of For command

Postby Wengier » 2017-9-28 @ 12:01

This thread is about the FOR command. It is better to discuss elsewhere about other features like LFN support...
Wengier
Member
 
Posts: 110
Joined: 2014-9-03 @ 19:56


Return to DOSBox General

Who is online

Users browsing this forum: No registered users and 1 guest