TechieSooner
Supreme [H]ardness
- Joined
- Nov 7, 2007
- Messages
- 7,601
Code:
@ECHO OFF
ping 192.168.0.2 | find "Reply" /c > log.txt
del log.txt
if log.txt==4 ECHO SYNCTOY
PAUSE
I basically want this to say "If the ping works- run SyncToy".
Don't know how I can do this.
All the ping/find command does is output the number 4 if I get 4 replies- so that's something to validate against.
However- how do I validate against that??? I thought an "if EXIST log.txt ECHO SYNCTOY" but the problem with that is even if the ping fails, a file still gets created.
Any ideas/suggestions on how to do this?