Quantcast
Channel: Active questions tagged windows - Super User
Viewing all articles
Browse latest Browse all 9687

Check if netsh wlan connect failed in batch script

$
0
0

I'm writing a batch script that should connect to a specific wireless network and begin a download from a NAS share drive on that network.

Obviously, before any download can be performed, I must check that the machine is connected to the correct network.

How can I check that I have connected to the correct network?

The relevant section of my batch script is thus:

...netsh wlan add profile filename=%_SCRIPT_PATH%MyWireless.xmlnetsh wlan connect name=MyWireless...

Where MyWireless.xml is a netsh exported network profile generated by:

C:\Users\Daemon>netsh wlan export profile folder=C:\Users\Daemon\ name=MyWireless

Viewing all articles
Browse latest Browse all 9687