Automatically log into a network with a captive portal in Windows?

I don't know about simple... I use a tool called webinject.pl in order to test web sites. It's a perl script that allows you to specify inputs and expected results and could easily be configured for this. It might take you an hour to make it work.

As for how to automate it. The Windows Task Scheduler is pretty robust and can trigger on a myriad of events. You could tie it to a logon event or event log entry, or simply have it run every 5 minutes (that's a bit painful). For instance, I get an event 32 in the system log when I establish a network connection. That might do it.


You can use lynx (the version with SSL support) - a text based browser - with a cmd_args script file containing the commands needed to log in. You can generate such a script file by logging in to the wifi with lynx once and logging the input. Do this by calling lynx with the following argument:

lynx.exe -cmd_log=%USERPROFILE%\lynxlog.txt`

Then you can rename that file and use it by calling lynx as follows:

lynx.exe -cmd_script=FILENAME_HERE

Put this in a batch file. (Either use the full path to the lynx executable or set that path in the PATH environment variable.)

Once you get that working, make a scheduled task triggered by event id 10000 in source NetworkProfile of log Microsoft-Windows-NetworkProfile/Operational which calls it:

Task Scheduler trigger example

Personally, I bundle that with iexpress.exe to run it hidden in the background and make sure the scheduled task is set to run even if I'm not logged on. I just set this up on my computer a few weeks ago and it's been working great!

Source: My article on How to Automate Captive Portal Login.