2
1
I need to create a .bat file that will set a wireless connection, eg MyNetworkName, to a public network, so it won't be on Home or Work.
I have searched and I don't know how to do this.
2
1
I need to create a .bat file that will set a wireless connection, eg MyNetworkName, to a public network, so it won't be on Home or Work.
I have searched and I don't know how to do this.
0
Note this is not a definitive solution, but something that might get you or others well underway.
Whether or not a network is public is stored in the registry, which can be edited through batch files. For a static edit, the easiest method would be to prepare a .reg-file, then merging it with the registry using the regedit command, e.g. regedit.exe /s makepublic.reg
.
One of the keys involved in telling a home network from a public one, is HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\NetworkList\Profiles
, appended by the GUID of the network connection you wish to alter. The important values here seem to be Category and CategoryType, the first being zero for public networks and one for private networks. An example 'makepublic.reg':
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\NetworkList\Profiles\{01234567-89AB-CDEF-0123-456789ABCDEF}]
"Category"=dword:00000000
"CategoryType"=dword:00000000
Unfortunately, but not surprisingly, these values are not the only ones set by the Network Center when a connection type is changed to public and as it stands, the .reg-file is insufficient; other keys would need to be added to the list.
Your question is ambiguous - do you want to be able to switch between available wifi networks or switch an existing connection from Home or Work mode to Public mode? – Shevek – 2012-10-03T10:32:57.057
Also, which version of Windows? – Shevek – 2012-10-03T10:33:19.177
Follow the links here which should point you in the right direction.
– Bali C – 2012-11-13T14:59:53.763