Run a Windows DOS batch file every 10 seconds
This is how I will run two commands on Windows XP every 10 seconds. The example bath file is:
1 arp -s 192.168.1.254 xx-xx-xx-xx-xx-xx<br />ipconfig /flushdns
First Attempt
1 :top<br />arp -s 192.168.1.254 xx-xx-xx-xx-xx-xx<br />ipconfig /flushdns<br />sleep 10<br />goto top
Remark: sleep isn’t included by default. You’ll need something like the Windows 2003 Resource Kit, or some other trick to simulate it (the ping trick), and notes to do so can be found here.
Second and working Attempt
1 :loop<br />arp -s 192.168.1.254 xx-xx-xx-xx-xx-xx<br />ipconfig /flushdns<br />ping localhost -n 11 > nul<br />goto loop<br />
The ping command will execute for 10 seconds, and all the output will be redirected to the NUL device, meaning that you will see no output from the ping command. It works indeed as a "sleep" command would.
Alternative
- Install Cygwin which will make
1sleep
and
1cronavailable to you (among other things).
About arp
Microsoft DOS arp command is used to displays, adds and removes arp information from network devices.
Examples
arp -a
Interface 220.0.0.80
Internet Address Physical Address Type
220.0.0.160 00-50-04-62-F7-23 static
The Physical Address or MAC address as shown above in the format aa-bb-cc-dd-ee-ff is the unique manufacturer identification number. This number should always be a unique address.
An example of how to change the above IP address 220.0.0.160 to 220.0.0.161 in this case would be:
arp -s 220.0.0.161 00-50-04-62-F7-23
If an IP address has already been assigned to the specific network adapter it is not possible to change that assigned IP address to a new address. In addition, networks italicizing DHCP, BOOTP or RARP will automatically assign the card an IP address, therefore, this command would not be utilized.

