Hi Steven,
I was able to get the WiFi Hotspot working with RealVNC on my Win 10 Pro laptop and switch automatically without adding all of the above script. Just use the Win 10 Pro WiFi connection setup tools, create the secured (password) connection to the RPI3 board which has the built-in password protect feature and when my laptop is in range it switched automatically to the rpi WiFi hotspot and disconnected from my home WiFi. When I powered down the rpi my laptop switched back to my secured home Wifi.
-Richard