In Windows we can set various filters in our computer to prevent connecting our computer from certain type of wireless networks. It help us to increase the security of our computer from possible attacks of hackers by preventing our computer from connecting to unsecured untrusty wireless networks.
Why should not we connect to an untrusty network ? Eg: One of the major potential security threat is connecting to unknown adhoc network. If the file and printer sharing is enabled in our computer, it will be much easy for a hacker to penetrate in to the data stored in our computer.
Prevent computer from connecting to untrusty network by enable filters So to avoid this kind of situation it is better set some Wireless filters in our computer to prevent connecting our computer to an unknown network accidentally. (Some times our computer can be misleaded by the wireless network name stored in profile with an external untrusty network with same name.)
Set / Enable Wireless Filter on your computer for Adhoc / Infrastructure networks
You can set wireless filters for both adhoc wireless network and infrastructure networks.
To enable wireless filter on your computer you can use following command prompt command in DOC prompt.
netsh wlan add filter permission={allow|block|denyall} ssid=NETWORKNAME networktype={infrastructure|adhoc}
Where the implementation of this command is as follows.
See I need to set a filter for wireless network "Siju1" on my computer. It is an adhoc network. Then the command to enable filter to block this wireless network is:
netsh wlan add filter permission=block ssid=siju1 networktype=adhoc

Here in my computer Wlansvc service was not running to enable this command. So I enabled it by following the steps in the link below.
Enable wlansvc (Wireless AutoConfig Service) on your computerNext error message shows my command prompt is not running as administrator. To enable wireless filter on my computer my command prompt should run as administrator. Follow the steps to run your command prompt as administrator.
Run command prompt as administratorNow again run the same command as above.

Now we have successfully add a wireless filter for the wireless network siju1.
Show enabled Wireless filters in our computer To display available wireless networks in our computer, use the following command on command prompt.
netsh wlan show filters

Here you can see the already created filter for wireless network siju1.
Technology Blog