中国DOS联盟论坛

China DOS Union

-- Unite DOS · Advance DOS · Grow DOS --
Union site: www.cn-dos.net Forum site: www.cn-dos.net/forum
Guest | Log in | Register | Members | Search | China DOS Union
中国DOS联盟论坛
The time now is 2026-09-23 13:01
47,812 topics / 349,917 posts / today 0 new / 48,273 members
DOS批处理 & 脚本技术(批处理室) » [Help] How to run a local program in a loop under DOS
Printable Version  2,302 / 2
Floor1 lingyang Posted 2016-03-30 08:43
新手上路 Posts 2 Credits 5
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!
Floor2 yishanju Posted 2016-04-09 01:27
银牌会员 Posts 1,357 Credits 1,488
This is called a batch processing, not DOS. Change % to %%
Floor3 zzz19760225 Posted 2016-04-09 22:15
超级版主 Posts 2,020 Credits 3,673
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 ]
[ Contact the Union admin team - 中国DOS联盟 - Standard version ]
Sponsored by ifanr Inc | © 2001–2023