Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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.

share|improve this question

closed as not a real question by Canadian Luke, 8088, TFM, BBlake, kmarsh Nov 13 '12 at 18:45

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.If this question can be reworded to fit the rules in the help center, please edit the question.

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

1 Answer 1

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.

share|improve this answer
add comment

Not the answer you're looking for? Browse other questions tagged or ask your own question.