3

In any version of Windows, how can I put my wireless network card in ad-hoc mode through the command prompt?

I want to do this because I want to hide this from the user (ie. I don't want them to have to do by themselves) I'd rather do this using an API or native windows function, but since I found no static approach in any version of Windows, I figured that the CLI is the next best thing.

2 Answers 2

2
netsh wlan del filter permission=denyall networktype=adhoc

removes any filtering for ad-hoc networks.

You can then use

netsh wlan connect ssid="SSID" name="Profile" interface="Interface"

to connect to a network, where you need to fill in the quotation marks.

The syntax and whether parameters are optional are outlined in this TechNet document.

2
  • This will connect to an already existing network? Can it also be used to create/initialize a new ad-hoc network?
    – Unknown
    Oct 31, 2011 at 20:35
  • @Unknown: I don't know of another way. Although you could try to figure out with Process Monitor what registry values are accessed to create such a profile and then replicate it with the reg command or by producing a .reg file and importing it. Oct 31, 2011 at 21:01
0

To create an adhoc wifi:

netsh wlan set hostednetwork mode=allow ssid=<your desired network name> key=<your_desired_password>
netsh wlan start hostednetwork

To stop:

netsh wlan stop hostednetwork

To get status:

netsh wlan show hostednetwork

You must log in to answer this question.

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