; https://autohotkey.com/boards/viewtopic.php?f=5&t=18865&hilit=post+to+webpage #SingleInstance,Force ; Only allow one instance of the script to run at a time #NoEnv wb := IEGet() ; Retrieve pointer to existing IE window/tab if !wb wb := ComObjCreate("InternetExplorer.Application") ; Or open a new IE window wb.Visible := true wb.Silent := true wb.Navigate("http://192.168.0.1/") ; Navigate to router login page ; Wait for page to be completely loaded while wb.ReadyState != 4 Sleep 10 ; Resize IE window try wb.Document.parentWindow.moveTo(0,0) try wb.Document.parentWindow.resizeTo(A_ScreenWidth,A_ScreenHeight) ; Populate login form elements ; Username not needed on Virgin Media Router ; user:="" ; try wb.document.getelementbyid("username").value := "Admin" pass:="mypassword" ; Use your own router's admin password here; NOT the SSID password try wb.document.getelementbyid("password").value := pass ; Call the javascript SignIn() function js := "javascript:SignIn();" try wb.document.parentwindow.execScript(js) ; Optional Wait a couple of secounds for page to start loading ;sleep, 2000 ; Wait for page to be completely loaded while wb.ReadyState != 4 Sleep 10 ; // Now we are/should be logged in and presented with our landing page. ; // do something else here or navigate directly to prefered options page. wb.Navigate("http://192.168.0.1/VmRgRebootRestoreDevice.html") ;Navigate to reboot device page. ; Wait for page to be completely loaded while wb.ReadyState != 4 Sleep 10 ; Call the rebootDevice() js function js:="javascript:rebootDevice();" try wb.document.parentwindow.execScript(js) sleep, 3000 ;Close browser window wb.quit() return ; Function: IEGet() ; Retrieve pointer to existing IE window/tab IEGet(Name="") { IfEqual, Name,, WinGetTitle, Name, ahk_class IEFrame Name := ( Name="New Tab - Windows Internet Explorer" ) ? "about:Tabs" : RegExReplace( Name, " - (Windows|Microsoft) Internet Explorer" ) For wb in ComObjCreate( "Shell.Application" ).Windows If ( wb.LocationName = Name ) && InStr( wb.FullName, "iexplore.exe" ) Return wb If InStr( wb.FullName, "iexplore.exe" ) Return wb } ; written by Jethrow