3

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.

3
  • 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
    Oct 3, 2012 at 10:32
  • Also, which version of Windows?
    – Shevek
    Oct 3, 2012 at 10:33
  • Follow the links here which should point you in the right direction.
    – Bali C
    Nov 13, 2012 at 14:59

1 Answer 1

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.

Not the answer you're looking for? Browse other questions tagged .