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-08-01 11:23
中国DOS联盟论坛 » DOS批处理 & 脚本技术(批处理室) » [Help] How to run a local program in a loop under DOS View 2,152 Replies 2
Original Poster Posted 2016-03-30 08:43 ·  中国 北京 电信
新手上路
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, and each time they are fixed, no need to care; input and output are folders, each time it is to get data from input, and output is to store data after running, which is also fixed; 50136 is a variable, there are a total of 2522, each time it is to read text data from 50136 in input, and save the result in the 50136 folder in output after execution. 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, but 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 it went wrong.

Thank you friends for your guidance!
Floor 2 Posted 2016-04-09 01:27 ·  中国 广西 电信
银牌会员
★★★★
[b]看你妹啊[/b]
Credits 1,488
Posts 1,357
Joined 2006-05-20 12:00
20-year member
UID 55770
Status Offline
This is called a batch processing, not DOS. Change % to %%

有问题请发论坛或者自行搜索,再短消息问我的统统是SB
Floor 3 Posted 2016-04-09 22:15 ·  中国 上海 徐汇区 联通
超级版主
★★★★
Credits 3,673
Posts 2,020
Joined 2016-02-01 00:00
10-year member
UID 181465
Gender Male
Status Offline
Originally posted by yishanju at 2016-4-9 01:27:
This is called batch processing, not DOS.

Replace % with %%

~~~~~~~~~~~~~~~~~~~
Excuse me, do you have any introductory books on character display principles, or any books at any level that cover the calculations related to displaying Chinese characters and English letters as characters, as well as content related to graphics cards and monitors? (Chinese books! If you have any, you can upload them to the forum, and I will give you points)

[ Last edited by zzz19760225 on 2016-4-9 at 22:17 ]
1<词>,2,3/段\,4{节},5(章)。
Forum Jump: