You would want ping() or osping()
If not reachable net stop wlansvc, net start wlansvc should suffice. Maybe throw in ipconfig renew... After that netsh WLAN status.

Can't write anything solid on this phone but it is quite straightforward
_________________________
!

download KiXnet