Saturday, July 17, 2010

♦ Batch file command (windows 7)

#1. Simple control Loop
syntax  :  for /l %%X in (start, step, end) do command
filename : runloop.bat

@echo off
for /l %%X in (1,2,10) do echo %%X
c:\windows>runloop [Enter]
1
3
5
7
9

#2. Apply with "ping" command
@echo off
for /l %%X in (5,1,10) do call ping 192.168.0.%%X -n 1
Description: Our objective is we will ping 192.168.0.5 to 10 where for each ping command reply one time as shown as parameter " -n 1 "

No comments:

Post a Comment