I found information to use to connect to a Wifi using the netsh command line.
http://www.hanselman.com/blog/HowToConnectToAWirelessWIFINetworkFromTheCommandLineInWindows7.aspx

I used this command to connect to Wifi and this SSID is not at my office , however it
still shows Connection request was completed successfully.
So whether the SSID is there or not it always returns connection request
was completed successfully.

I am trying to do is that if I am at home I connect to the WLAN if the
hardwire is not connected. I have it in my startup .

If you have any input I would appreciate it. Windows 10 must have done
something different

Windows 10 both profiles are in the system. I am at WORK and MywifiN2 is not available

netsh wlan connect name="MywifiN2" (trying to connect to the SSID not there) even if I use ssid="MywifiN2" same
Connection request was completed successfully.

netsh wlan connect name="MyWork"
Connection request was completed successfully.
(The wifi connects and no issues)
Wifi connects when I do this at home to the home network
netsh wlan connect name="MywifiN2"
if %ERRORLEVEL%==0 (
echo "Home wifi Connected."
) else (
echo "I am at work no wifi"
)
"Home wifi connected"
No matter what I always get the ERRORLEVEL to be 0 (successful), and it is connecting to the work
On Windows 7 it works fine
netsh wlan connect name="MywifiN2"
The network specified by profile "MywifiN2" is not available to
connect.
netsh wlan connect name="MyWork"
Connection request was completed successfully.

netsh wlan connect name="MywifiN2"
The network specified by profile "MywifiN2" is not available to
connect.
if %ERRORLEVEL%==0 (
echo "Home wifi Connected." ) else (
echo "I am at work no wifi"
)
"I am at work no wifi"

thanks