Sign in with
Sign up | Sign in
Your question

Auto Connect to Ad-Hoc Wifi Network in Win7

Last response: in Wireless Networking
Share
March 12, 2010 1:17:13 AM

i dont care about the security risks, i am looking to automatically connect to my phone's ad-hoc network (i use wmwifirouter). i can set it to not use a password, but i still have to click on 'wireless icon, connect' in the win7 system tray. even if i use a password there is no option to auto connect like there is to normal access points.

also, since this ad-hoc network shows up randomly (whenever i activate it on my phone) i need the computer to just recognize it and log on for me. i have seen fixes to connect to ad-hoc's upon login to windows, but that wont really help me... it needs to do it anytime the ad-hoc wifi network gets in range, without user interaction.
March 12, 2010 1:43:45 AM

I assume you found a fix similar to the following:

http://www.online-tech-tips.com/computer-tips/ad-hoc-ne...

Have you tried perhaps just running it once a minute? Maybe if it's already connected it will just not do anything. Or perhaps create a batch file that checks for a valid ping response to some location that should be accessible if the connection is up. If not, you issue the connection (netsh...).

No it's not pretty, but for a quick and dirty solution, it might be enough.
m
0
l
March 12, 2010 2:46:32 AM

it is just for a car computer, so a batch file sending a ping request every 15 seconds or so wouldnt be a horrible thing. if you have a link that shows me how to do all that i would appreciate it, if not thats fine i am sure i can google enough to figure it out! i didnt really think about pinging and auto-command... i know how to make cmd files and all i just would have to figure out the code lines themselves
m
0
l
Related resources
March 12, 2010 3:07:50 AM

unionpride said:
it is just for a car computer, so a batch file sending a ping request every 15 seconds or so wouldnt be a horrible thing. if you have a link that shows me how to do all that i would appreciate it, if not thats fine i am sure i can google enough to figure it out! i didnt really think about pinging and auto-command... i know how to make cmd files and all i just would have to figure out the code lines themselves


I would first just trying running the netsh command as in that article every minute. For all I know, if the connection is already established, it may just notice that it is, and do nothing, it will just quit. You only need to consider an explicit check if by issuing the connection request it cause any existing connection to drop and reconnect (obviously not what you want). Or maybe there's even an option in netsh to do that very thing (i.e., only connect if not connected). IOW, keep it simple until you're forced to make it complicated.

I’d check it myself except I don’t have a wireless client available let alone an adhoc one.

m
0
l
March 12, 2010 3:10:22 PM

you know theres something different about win7 i think. even though the wifi adhoc network shows in in the system tray the same as all the other wifi points in the area, it does show it as a network not an access point.

SO, even if i go into win7's "manage wireless networks" and try to add the ad-hoc wifi manually, it accepts the configuration but it acts like what i set up is completely separate from the actual ad-hoc that is broadcasting.

the netsh command does not work, it does not allow the network to auto connect and i think its because win7 treats ad-hoc wifi networks different now. everywhere online i have seen this asked it has never been answered, so it might be something that isnt possible?
m
0
l
May 12, 2011 3:01:02 PM

Thanks! $30 is a steep price, but if its something you can use for years and years then its not so bad i guess.
m
0
l
January 8, 2012 12:54:30 AM

unionpride said:
i dont care about the security risks, i am looking to automatically connect to my phone's ad-hoc network (i use wmwifirouter). i can set it to not use a password, but i still have to click on 'wireless icon, connect' in the win7 system tray. even if i use a password there is no option to auto connect like there is to normal access points.

also, since this ad-hoc network shows up randomly (whenever i activate it on my phone) i need the computer to just recognize it and log on for me. i have seen fixes to connect to ad-hoc's upon login to windows, but that wont really help me... it needs to do it anytime the ad-hoc wifi network gets in range, without user interaction.



1. Create a manual profile with same ssid as to which adhoc network you want to connect. Ensure to untick connect automatically.

2. Start cmd.exe as adminisatrator and type netsh. Press Enter. Type wlan. Press Enter.
Type export profile folder="C:\Profiles" in cmd.
Your exported profile will be saved in "C:\Windows\System32" by default if folder not specified.

3. Copy the exported profile file on your desktop and open in Notepad.
Replace ESS by IBSS.
Ensure that the next line contains "Manual". If it contains "Automatic" then,
recreate the profile in step 1 wth "start this connection automatically" ticked off.
Save and close the file.
Ensure that you are not connected to any network before proceeding to next step.

4. Back in cmd type
add profile filename="C:\Users\$X$\Desktop\$$Filename$$.xml" interface="interface type of connection"
Check by connecting to the desired network. It should not ask for any password prompt.

5. Schedule the task in scheduler.
program: netsh.exe
arguments: wlan connect name="proflename"
m
0
l
!