命令循环处理批处理文件

时间:2020-06-10 10:47:32

标签: windows batch-file command-line command

是否可以每2分钟一次循环执行ping.exe文件。

BAT文件可以是:

2020-06-10T10:34:15.6572519Z ##[error]Execution of remote script job failed. ComputerName: '###', Message: 'Exception calling "Create" with "1" argument(s): "At line:12 char:297
+ ... n Sync Service - DEVELOP' -containerSasToken '?sv=2015-04-05&sr=c&sig ...
+                                                                 ~
The ampersand (&) character is not allowed. The & operator is reserved for future use; wrap an ampersand in double quotation marks ("&") to pass it as part of a string.

At line:12 char:302
+ ... c Service - DEVELOP' -containerSasToken '?sv=2015-04-05&sr=c&sig=IRc3 ...
+                                                                 ~
The ampersand (&) character is not allowed. The & operator is reserved for future use; wrap an ampersand in double quotation marks ("&") to pass it as part of a string.

At line:12 char:357
+ ... &sr=c&sig=IRc3wRXJkxsNXMvF%2FbklPRBhelc1qY2%2BDfCVKj2xBlk%3D&se=2020- ...
+                                                                 ~
The ampersand (&) character is not allowed. The & operator is reserved for future use; wrap an ampersand in double quotation marks ("&") to pass it as part of a string.

At line:12 char:385
+ ... FbklPRBhelc1qY2%2BDfCVKj2xBlk%3D&se=2020-06-10T14%3A34%3A08Z&sp=rwdl' ...
+                                                                 ~
The ampersand (&) character is not allowed. The & operator is reserved for future use; wrap an ampersand in double quotation marks ("&") to pass it as part of a string.

At line:12 char:8105033
+ ... tqBTFKkFalM7qofnRBLTVr0rsI6yuGNFCoXwvAAAAAAA=' -CleanTargetBeforeCopy
+                                                  ~~~~~~~~~~~~~~~~~~~~~~~~
The string is missing the terminator: '."'
2020-06-10T10:34:15.7919052Z ##[section]Finishing: Copy files

1 个答案:

答案 0 :(得分:1)

是的。创建设备列表,使用-n

提供的ping选项对它们进行ping操作
@echo off
:start
set "myips=localhost,127.0.0.1,google.com"
for %%a in (%myips%) do ping %%~a -n 121
goto :start