China DOS Union

-- Unite DOS · Advance DOS · Grow DOS --

Union site: www.cn-dos.net Forum site: www.cn-dos.net/forum
DOS stands for freedom, openness and progress. Let us work hard, learn from the openness and GNU spirit of FreeDOS and Linux, and together build and grow a free GNU GPL world!

中国DOS联盟论坛
The time now is 2026-06-25 08:44
中国DOS联盟论坛 » 其它操作系统综合讨论区 » [Help]『Original Poster』: How to run a local program in a loop under DOS View 2,066 Replies 0
Original Poster Posted 2016-03-30 08:46 ·  中国 北京 电信
新手上路
Credits 5
Posts 2
Joined 2016-03-29 09:08
10-year member
UID 181537
Gender Male
Status Offline
Description: There is a program (MWC) on the local C drive (can be placed on other drives) that needs to call local files to process a large amount of data. Each time the program can only call one file, there are a total of more than 2500 (in the input folder, in the same directory as the main program). The running results are placed in the output folder (in the same directory as the main program, and the folder name corresponds one-to-one with the input folder name).

Help: How to call the local program in DOS to run in a loop until it ends.

The following is the calling code in DOS:
Microsoft Windows [Version 10.0.10240]
(c) 2015 Microsoft Corporation. All rights reserved.

C:\Users\ly>cd \

C:\>cd mwc

C:\MWC>mwc -iinput/50136 -ooutput/50136 -smfx both all

Among them, -i, -o, -smfx both all are all parameters of the MWC program, which are fixed each time and do not need to be cared about; input and output are folders, each time it goes to input to get data, and after running, it stores data in output, which is also fixed; 50136 is a variable, there are a total of 2522, each time it goes to read the text data in input/50136, and after execution, it saves the result in the output/50136 folder. That is, the variable name in input and the variable name in output should correspond one-to-one.

I initially executed FOR /F in DOS and it didn't succeed.

for /f %x in (50136 50137) do c:/MWC/MWC -iaa/%x -oaa_out/%x -smfx both all

I don't know where the mistake is.

Thank you friends for your guidance!
Forum Jump: