("ping -n 1 " $HostName

should be:
("ping -n 1 " + $HostName
_________________________
!

download KiXnet