windows - 如何按照用户输入指定的次数运行命令?

标签 windows batch-file command-line cmd

我想在批处理文件控制台上从用户那里获取整数输入并按此输入时间运行。

所以如果我在开始时输入 10。

start test.exe 必须运行 10 次。

我如何在批处理文件中写入这个?

最佳答案

您可以使用 FOR/L 命令。

@ECHO OFF
SET /p num=How many times:
FOR /L %%I IN (1,1,%num%) DO START "My Title" "test.exe"

关于windows - 如何按照用户输入指定的次数运行命令?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34594690/

相关文章:

windows - 如何使用 Batch For Loop 执行 ffmpeg

windows - Jenkins 没有完成 'execute windows command' 步骤

windows - x86 32 位汇编代码是否有效 x86 64 位汇编代码?

Windows 批处理文件 : Convert Structures into Single Lines Strings

c++ - 使用 WinHTTP API 限制带宽使用的方法

ruby-on-rails - 从Rails控制台删除多个记录

c# - *忽略* C++ 和 C# 如何在命令行中显示百分比

c++ - 在 Visual Studio 2005 中编译 Win32 "hello world"的命令行

windows - Windows批处理文件运行所有标签的问题

docker - 将命令从 docker 容器公开到主 shell