You're pinging your router and getting host unreachable (same thing as timed out, means windows tried to send data to the ip but didn't get a reply within the time limit). Sounds like you need to disconnect then reconnect. I usually disable my adapter then re-enable it. I'm sure there's a UDF floating around on the forum somewhere for reconnecting to wifi or disable/enable your network adapter.
Ok, now I get it, I use windows cmd or batch to reconnect the network adapter.
Thank you for the code, really appreciate that.