Hi Im Ricky I have been trying set something up for a long time now many months and have done a lot of googling and reading the forums/researching gleaming info here and there before coming here and asking for some help I am of the older generation not long before I draw my pension but after a couple of heart attacks and two strokes do stuggle at times with trying to figure out some of the script stuff but I do try to keep the grey matter alive..
Ok down to buisiness.. I need access to my pc remotely when I am away from home so I use wol to start my pc remotely over the internet, the router I use I have to enable telnet mode by accessing a hidden web page on the router and log in then I have telnet access..I then set up a static arp to my pc so as it knows where to send the wol magic packet to wake it up if I dont do this then when the pc is shut down the router clears the arp cache and doesnt know where to send the magic packet..ok so far this is all well and good but if I have a power failure of the router reboots then all is lost and it goes back to default no telnet acces and no static arp route to my pc so no remote access..
Ok I decided to write a script that when the computer is auto powered on early in the am it runs a script that opens an ie windows and navigates to the enable telnet page logs in with user name and password then closes it then it calls a program/script called arse (Automatic Router Scripting Engine is a tool to send command scripts to your router automatically via telnet)written in autoit by cor a very nice utility.. which sets the static arp.. thats it..
The problem I am having is that it works fine half a dozen or so times then for some reason it seems to lose focus of the login window and does nothing unless I click anyware in the login window the it logs in and closes the ie session and then runs arse as it should do.
What I was hopeing for was someone to cast an eye over the script and see if theres any faults or maybe a better way to do this so as it is reliable and doesnt loose focus on the login popup..
anyways thanks for your time heres the script
regards
Ricky
#AutoIt3Wrapper_UseX64=N $uNAME = "user" ;Change to your username to your router username $uPASS = "pass" ;Change to your password to your router password $oIE = ObjCreate ( "InternetExplorer.Application" ) $oIE.Visible = 1 $oIE.Left = 600 $oIE.Top = 300 $oIE.Width = @DesktopWidth /4.4 $oIE.Height = @DesktopHeight /3.4 $oIE.Menubar = 0 $oIE.Toolbar = 0 $oIE.Statusbar = 0 $oIE.Resizable = 0 $uRL = "192.168.1.2/setup.cgi?todo=debug" ;Send the command to enable telnet on dgnd3700v2 $oIE.Navigate ($uRL) Sleep (800) WinWaitActive ("Windows Security", "" ,1000000) WinActivate ("Windows Security") ControlSetText("Windows Security", "", "Edit1", ($uNAME)) Sleep (500) ControlSetText("Windows Security", "", "Edit2",($uPASS)) Sleep (500) ControlClick ("Windows Security", "", "Button2") Sleep (500) controlfocus("http://192.168.1.2/setup.cgi?todo=debug - Windows Internet Explorer", "Class:IEFramehttp://192.168.1.2/setup.cgi?todo=debug - Windows Internet Explorer", "Internet Explorer_Server1");Focus on the finished ie window Sleep (100) WinClose("http://192.168.1.2/setup.cgi?todo=debug - Windows Internet Explorer") ;Close the finished ie window Sleep (600) ShellExecute("NetSet.arse") ;Set static arp Exit