DonationCoder.com Forum

DonationCoder.com Software => Coding Snacks => Post New Requests Here => Topic started by: aka_bigred on January 04, 2008, 11:08 AM

Title: IDEA: Wireless network detector & IP settings changer
Post by: aka_bigred on January 04, 2008, 11:08 AM
I have always wanted a little app that would automatically detect the wireless network you are connected to and change the IP settings accordingly. 

For example, when I'm at work, the SSID=WORK, and I need the wireless card set for DHCP.
When I'm at home, SSID=Home, change it to pre-defined static IP & DNS servers.

I had looked around some time ago, and there's a way to change the IPCONFIG settings via batch/command line, but my problem is detecting the connected SSID.  It shouldn't be too hard, just an array of SSID's and the associated IPCONFIG settings for each SSID.  When the SSID changes, check the profile listing for that SSID and implement those associated settings.
Title: Re: IDEA: Wireless network detector & IP settings changer
Post by: jgpaiva on January 04, 2008, 11:27 AM
I think you're looking for netsetman (http://www.netsetman.com/) :)
Title: Re: IDEA: Wireless network detector & IP settings changer
Post by: aka_bigred on January 04, 2008, 01:27 PM
Yeah, something along those lines, but want it to AUTOMATICALLY activate a profile when a specific wireless SSID is detected.  That app looks like you have to manually activate the profile.  Detecting the SSID tells what network I'm on so it should be able to activate a profile without my intervention.

I don't need all the extra bells & whistles that has, just basic IP settings per detected SSID.
Title: Re: IDEA: Wireless network detector & IP settings changer
Post by: jgpaiva on January 04, 2008, 02:19 PM
Oh, i thought that netsetman was able to do that :(

But i just made a quick search and found this (http://www.autohotkey.com/forum/topic18685.html) on the ahk forum! :D

So, do you want me to make a script that will check the ssids, and when it changes to one on a predifined list, run the associated batch file?
Title: Re: IDEA: Wireless network detector & IP settings changer
Post by: aka_bigred on January 09, 2008, 02:05 PM
I saw that post, but looks like it's an on-demand script.  If it ran continuously and kicked off a batch script like you suggest, that'd be sweet!


Oh, i thought that netsetman was able to do that :(

But i just made a quick search and found this (http://www.autohotkey.com/forum/topic18685.html) on the ahk forum! :D

So, do you want me to make a script that will check the ssids, and when it changes to one on a predifined list, run the associated batch file?
Title: Re: IDEA: Wireless network detector & IP settings changer
Post by: jgpaiva on January 09, 2008, 04:28 PM
Ok, done.

I attached a .zip to this post, with the .ahk source file and with a compiled version.

It checks every 5 seconds for changes in the SSID, and if so, it compares the current SSID against a pre-defined list of SSIDs specified in the .ini file, and if it detects the current one is one of them, it launches the associated action.

I think the .ini file is self-explanatory, but if you have some trouble, just post here ;)
Title: Re: IDEA: Wireless network detector & IP settings changer
Post by: Carol Haynes on January 10, 2008, 01:42 PM
Can't you just set up connections to two different networks in the Connection Manager with the different settings then it will connect to whichever network is available?
Title: Re: IDEA: Wireless network detector & IP settings changer
Post by: magonicola on March 31, 2009, 04:40 PM
Ok, done.

I attached a .zip to this post, with the .ahk source file and with a compiled version.

It checks every 5 seconds for changes in the SSID, and if so, it compares the current SSID against a pre-defined list of SSIDs specified in the .ini file, and if it detects the current one is one of them, it launches the associated action.

I think the .ini file is self-explanatory, but if you have some trouble, just post here ;)

Hi,
first of all thanks for your attachment, very nice & usefull.
In particular this attachment has quite solved my problem: reconfiguring IP settings on SSID change. HOW? Your file lunch a BAT file made by netsh instruction that calls a txt files with appropriate config inside.

Now there's only a problem: sometimes your script gives me a run-time error (800a0046 code) of "cannot access to file" (privileges), the file is obviously SSID.txt, so I can't be "safe" to leave the pc alone and on being sure that it will change autometically the IP settings. (I don't know why this: your script works for minutes and only a few times at hour has got this error popup. Maybe, I think, 5 seconds of delay is not enough when CPU is stressed)
If you can fix this error you will solve not only my situation, but the problem of so many people.
THANKS!
Title: Re: IDEA: Wireless network detector & IP settings changer
Post by: jgpaiva on April 08, 2009, 05:27 PM
Hi magonicola!
To be honnest, I don't quite know why that happens. Could you post a printscreen of the error?
Title: Re: IDEA: Wireless network detector & IP settings changer
Post by: potofcoffee on May 28, 2009, 06:54 AM
I think what you're really looking for is Net Profiles (http://code.google.com/p/netprofiles/), recently open-sourced. Any help is appreciated.
Title: Re: IDEA: Wireless network detector & IP settings changer
Post by: mouser on May 28, 2009, 07:00 AM
Net Profiles, recently open-sourced
very cool  :Thmbsup: welcome to the site.