Cannot ping second time in a loop

manraw90

Honorable
Mar 24, 2012
1
0
10,510
-------zzz.bat------
sleep 2
ping 192.168.3.52
ping 192.168.3.48
arp -a>arpt.txt
arp -d
START CMD /C CALL "arpt.bat" [args [...]]
exit
--------arpt.bat---------
set path=C:\Java\bin
javac apples.java
java apples
cls
START CMD /C CALL "zzz.bat" [args [...]]
exit

------test.bat------
:startloop
ping 192.168.3.52
ping 192.168.3.48
sleep 2
goto startloop


'zzz.bat' pings the above address first time but when 'arpt.bat' calls 'zzz.bat' again error comes as 'ping' is not recognized as internal or external command..........whereas 'test.bat' works perfectly

 
Why would you code batch files that loop? Test.bat works because you don't reset the path to C:\Java\bin.

You should modify arpt.bat as follows:

--------arpt.bat---------
C:
cd \Java\bin
javac apples.java
java apples
cls
START CMD /C CALL "zzz.bat" [args [...]]
exit