I have the following batch file:
:LOOP ping %1 ping %2 goto LOOP
This file only works with two command line options. How to make this work with a variable number of command line options. For example, if four command-line options were provided at run time, then it should ping on all four servers.
Any help appreciated
, , shift. . , , , .
shift
%*, :
%*
@echo off :loop for %%x in (%*) do ping %%x goto :loop
SVN-.
EDIT: Johannes, , script:
:
:loop if %1x==x goto :EOF ping %1 shift goto :LOOP
:loop2 call :loop %* goto :loop2 :loop if %1x==x goto :EOF ping %1 shift goto :LOOP
Source: https://habr.com/ru/post/1754689/More articles:dynamically resize images w / jquery - jqueryClosing a DataMapper DB Connection - ruby ββ| fooobar.comC # WebBrowser Flash fullscreen - ESC will not exit full-screen mode - c #confusing C code, does someone explain this to me? - cPHP - returns different types of values ββfrom the same method - phpWebClient, what does UploadString do? - .netUploadString (Post method) in VB.NET not working - postHow to get the full name of a property from lambda - c #music site: how to make it work on Android and Blackberry / iphone / symbian? - androidHow to manage namespace prefixes in an XML document generated by XmlWriter-generated XAML with x markup extension: Type - xmlAll Articles