你怎么在循环Windows批处理文件? [英] How do you loop in a Windows batch file?

查看:139
本文介绍了你怎么在循环Windows批处理文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

什么是Windows批处理文件的语法的循环?


解决方案

  FOR %% A IN(名单)DO命令参数

列表是任何元素的列表,方法是空格分隔,逗号或者分号。

命令可以是任何内部或外部命令,批处理文件,甚至 - 在OS / 2和NT - 命令列表

参数包含命令的命令行参数。
在这个例子中,命令将被一次在列表中的每个元素执行,如果指定使用的参数。

一个特殊类型的参数(甚至命令)是%% A,将由每个元素从列表中可以连续substituded。

循环

What is the syntax for a FOR loop in a Windows batch file?

解决方案

FOR %%A IN (list) DO command parameters

list is a list of any elements, separated by either spaces, comma's or semicolons.

command can be any internal or external command, batch file or even - in OS/2 and NT - a list of commands

parameters contains the command line parameters for command. In this example, command will be executed once for every element in list, using parameters if specified.

A special type of parameter (or even command) is %%A, which will be substituded by each element from list consecutively.

From FOR loops

这篇关于你怎么在循环Windows批处理文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆