| View previous topic :: View next topic |
| Author |
Message |
azure
Joined: 07 Jun 2007 Posts: 296
|
Posted: Thu Jun 28, 2007 4:02 am Post subject: change ip |
|
|
hello
I would like a hotkey to disconnect me from the internet, wait 3 seconds and reconnect, in order to change ip
is it possible?
thanks |
|
| Back to top |
|
 |
aCkRiTe
Joined: 21 Jul 2006 Posts: 502
|
Posted: Thu Jun 28, 2007 4:13 am Post subject: |
|
|
This uses the WinKey+r as the hotkey, but of course can be changed...
| Code: |
#r::
RunWait, %comspec% /c ipconfig/release, , Hide
RunWait, %comspec% /c ipconfig/renew, , Hide
Return
|
HTH.... |
|
| Back to top |
|
 |
Travley
Joined: 13 May 2007 Posts: 48
|
Posted: Thu Jun 28, 2007 4:14 am Post subject: |
|
|
| Code: | RunWait %comspec% /c ipconfig.exe /release
Sleep, 3000
RunWait %comspec% /c ipconfig.exe /renew |
| Quote: | The COMSPEC variable
SET COMSPEC=C:\DOS\COMMAND.COM
COMSPEC specifies the secondary command interpreter.
This need not be COMMAND.COM.
One example of a different command interpreter is JP Software's 4DOS.COM.
Replace COMMAND /C with %COMSPEC% /C if you do not know for sure which command interpreter will be used. |
lol got beat to it hehe |
|
| Back to top |
|
 |
Lexikos
Joined: 17 Oct 2006 Posts: 2558 Location: Australia, Qld
|
Posted: Thu Jun 28, 2007 8:42 am Post subject: |
|
|
Alternatively, | Code: | RunWait, ipconfig /release,, Hide
RunWait, ipconfig /renew,, Hide |
ipconfig is a program, rather than a command built into command prompt, so it doesn't require %comspec%. Btw, that quote is a bit outdated... %comspec% typically points to cmd.exe on NT-based systems.
DOS,
Has anyone verified if this actually works for dial-up connections? |
|
| Back to top |
|
 |
NotLoggedIn-Conquer Guest
|
Posted: Thu Jun 28, 2007 11:59 pm Post subject: |
|
|
| Its not working for my dial up. |
|
| Back to top |
|
 |
azure
Joined: 07 Jun 2007 Posts: 296
|
Posted: Fri Jun 29, 2007 1:23 am Post subject: |
|
|
| it doesnt working for my adsl |
|
| Back to top |
|
 |
Lexikos
Joined: 17 Oct 2006 Posts: 2558 Location: Australia, Qld
|
Posted: Fri Jun 29, 2007 2:45 am Post subject: |
|
|
I thought as much. How do you disconnect/reconnect manually? Does your IP address necessarily change if you do that?
The only (software) way to restart my ADSL router, for instance, is through the web interface. I haven't got the first clue how to automate web pages/javascript.
Edit: For dial-up in Win2k/XP, I think you could use rasdial. Using the examples at that link,
| Code: | ; replace "EAST OFFICE" with "The Name Of Your Connection"
RunWait, rasdial "EAST OFFICE" /d ; disconnect
RunWait, rasdial "EAST OFFICE" ; reconnect |
For Win9x, try rnaui.dll (VBScript example). |
|
| Back to top |
|
 |
NotLoggedIn-Conquer Guest
|
Posted: Fri Jun 29, 2007 4:10 pm Post subject: |
|
|
| With my dial-up, the IP address usually changes every disconnect/reconnect. |
|
| Back to top |
|
 |
NotLoggedIn-Conquer Guest
|
Posted: Fri Jun 29, 2007 4:20 pm Post subject: |
|
|
& @lexikos
Code works fine with disconnecting, but using the connecting code, it needs the username and password to be specified.
To connect with username/password:
| Code: | ; Replace EAST OFFICE, Username and Password with your info
RunWait, rasdial "EAST OFFICE" Username Password ; reconnect |
|
|
| Back to top |
|
 |
azure
Joined: 07 Jun 2007 Posts: 296
|
Posted: Wed Jul 04, 2007 2:22 am Post subject: |
|
|
| lexikos wrote: | | How do you disconnect/reconnect manually? Does your IP address necessarily change if you do that? |
I manually disconnect by double clicking on the connection tray icon and then click "disconnect" on its tab
then I wait 5 seconds
then I reconnect by clicking the shortcut on the desktop
it changes ip in most cases
how can I do all these with a hotkey? |
|
| Back to top |
|
 |
Sean
Joined: 12 Feb 2007 Posts: 1339
|
|
| Back to top |
|
 |
ggirf14
Joined: 01 Nov 2005 Posts: 96 Location: Ottawa
|
Posted: Wed Jul 04, 2007 3:43 am Post subject: |
|
|
| Why do you need to change IP address? |
|
| Back to top |
|
 |
Grumpy Guest
|
Posted: Wed Jul 04, 2007 3:37 pm Post subject: |
|
|
Perhaps to continue doing some bad job after its IP address has been blocked...  |
|
| Back to top |
|
 |
IPRefreshhh Guest
|
Posted: Tue Sep 18, 2007 4:30 pm Post subject: |
|
|
Came with console window but work.
speedy=your connection
user=user
pasword=password
| Code: | F12::
RunWait, %comspec% /k rasdial speedy /DISCONNECT & rasdial speedy user password & exit |
|
|
| Back to top |
|
 |
azure
Joined: 07 Jun 2007 Posts: 296
|
Posted: Wed Mar 05, 2008 1:38 am Post subject: |
|
|
thanks !
but, does this work for ethernet connections? |
|
| Back to top |
|
 |
|