cannot ping same address second time in a loop

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Post Reply
Message
Author
manraw90
Posts: 1
Joined: 24 Mar 2012 14:04

cannot ping same address second time in a loop

#1 Post by manraw90 » 24 Mar 2012 14:14

-------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' works fine 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....any solutions???

aGerman
Expert
Posts: 4743
Joined: 22 Jan 2010 18:01
Location: Germany

Re: cannot ping same address second time in a loop

#2 Post by aGerman » 24 Mar 2012 14:23

If you overwrite the PATH environment variable then you have to call the commands by their full name. Eg.:

Code: Select all

%systemroot%\system32\ping.exe 192.168.3.52 

Regards
aGerman

foxidrive
Expert
Posts: 6031
Joined: 10 Feb 2012 02:20

Re: cannot ping same address second time in a loop

#3 Post by foxidrive » 24 Mar 2012 14:26

set path=%path%;C:\Java\bin

Post Reply