ADSL Users please try the following software as a connect/disconnect program:
http://download.cnet.com/ReConnect/3000-2648_4-10560013.html
Method using wgetWithin your router there should be a page that enables you to connect/disconnect the router.
Once you know where this file is, view source and see what variables are being passed.
For Example:
Your router is 198.162.1.1 and there is a page called connect.html
locate the variables being passed within the source of the file say it posts "connect" with a value of "0"
So your router URL to pass would be : login:password/router IP/connect.html?connect=0
Then when you create the reconnect.bat file, you will add those paths to your .bat file.
You will need to get wget.exe in order to run the .bat file.
reconnect.bat
- Code:
-
@echo
echo %time%
wget.exe --delete-after http://login:password@router IP/path to disable
ping 127.0.0.1 -n 1 > NUL
wget.exe --delete-after http://login:password@router IP/path to enable
ping 127.0.0.1 -n 18 > NUL
The connect/disconnect is dependent on your router, so just look in your user manual for your router to find out where you can disconnect/connect or release/renew within your router/modem browser based administration.
wget can be downloaded here:
http://users.ugent.be/~bpuype/wget/
----------------------------------------------------------------------------------------------------------------------
Alternate method using curlIf curl is not installed you can find it here: http://www.paehl.com/open_source/?CURL_7.27.0
If you want to add sleep into your reconnect.bat file then download it here: http://www.paehl.de/reconnect/sleep.zip
- curl.exe and sleep.exe must be placed in the same directory that the reconnect.bat file is located.
If you know the name/model of your router then search for it here: http://www.paehl.de/reconnect/Curl_search.php
If your router is found then copy and paste the info displayed for your router into a new file.
- Edit the %USER%:%PWD%@%IP% part with your current settings:
User is router user name. PWD is router password. IP is IP of your router.
To get the IP of your router:
-> Start, run type in 'cmd' then click 'Ok'
-> In the black screen command line interface type ipconfig
-> The IP listed as default gateway is the IP address of your router.
Note: You should be able to login to your router by putting http://<router ip> into your browser and then entering username/password.
- save the file as reconnect.bat
- If you downloaded sleep.exe, then you can add a sleep call between the connect/disconnect calls using:
Sleep # seconds
----------------------------------------------------------------------------------------------------------------------
Alternate method using ipconfig:v1In order to get the needed values you need to run ipconfig.
Go Start->run type in 'cmd' (no quotes) and click 'Ok'.
type 'ipconfig /all' into the black command line screen.
before saving reconnect.bat removing all << comments as they are there for help purposes.
-- start reconnect.bat --
@ECHO OFF
set var hostname = myhostname << change to your hostname
set varip=119.94.113.26 << enter your current IP and change the last two to a number between 1-254
set varsm=255.255.240.0 << change to your subnet mask
set vargw=119.94.112.1 << change to your default gateway
set vardns1=58.69.254.1 << change to your dns server #1
set vardns2=58.69.254.135 << change to your dns server #2
set varhome=www.whatismyip.com
REM ***** You don’t need to change anything below this line! ******
ECHO Setting IP Address and Subnet Mask
netsh int ip set address name = "Local Area Connection" source = static addr = %varip% mask = %varsm%
ECHO Setting Gateway
netsh int ip set address name = "Local Area Connection" gateway = %vargw% gwmetric = 1
ECHO Setting Primary DNS
netsh int ip set dns name = "Local Area Connection" source = static addr = %vardns1%
ECHO Setting Secondary DNS
netsh int ip add dns name = "Local Area Connection" addr = %vardns2%
ECHO Setting Internet Explorer Homepage to %varhome%
reg add "hkcu\software\microsoft\internet explorer\main" /v "Start Page" /d "%varhome%" /f
ECHO Here are the new settings for %hostname%:
netsh int ip show config
pause
-- end reconnect.bat --
alternate commands -change values in braces to match your settingsChange IP address and default gateway:
netsh int ip set address "local area connection" static {192.168.1.101} 255.255.255.0 {192.168.1.1} 1
Change DNS:
netsh int ip set dns "local area connection" static {192.168.1.1} primary
Change back to DHCP:
netsh int ip set address "local area connection" dhcp
netsh int ip set dns "local area connection" dhcp
To correct should it not work
---- repair.bat ----
@ECHO OFF
ipconfig /release
ipconfig /flushdns
ipconfig /setclassid
ipconfig /registerdns
ipconfig /renew
EXIT
---- end repair.bat ----
If you have ipv6 installed:
--- configIP.bat ---
echo off
if "%1"=="static" goto static
if "%1"=="dhcp" goto dhcp
echo Usage: %0 (static^|dhcp)
goto end2
:static
echo Setting static IP of 192.168.xxx.xxx
netsh int ipv4 set address "Local Area Connection" static 192.168.xxx.xxx 255.255.255.0 192.168.xxx.xxx 1
echo Setting primary DNS server to 192.168.xxx.xxx
netsh int ipv4 set dnsservers "Local Area Connection" static 192.168.xxx.xxx primary
goto end
:dhcp
echo Setting Dynamic (DHCP) IP
netsh int ipv4 set address "Local Area Connection" dhcp
echo Setting Dynamic (DHCP) DNS
--- end configIP.bat ---
----------------------------------------------------------------------------------------------------------------------
Alternate method using Telnet scripting toolDownload telnet scripting tool here: http://www.mediafire.com/file/my1zi2zmmma/tst10.zip
Extract it to your C:\ drive so it's in C:\tst10
Edit the rebootscript.txt file with your router information.
Run the reboot.bat file.
EDIT by Sioc
If none of the routes mentioned above do work, you can try instead to make a script using Winautomation or Actionaz in order to automatically reset your router from its configuration page. Investing some efforts in this method may yield a very robust solution as well without having to dig into complicated knowledge of your router.