Forum     

Go Back   Digit Technology Discussion Forum > Software > Software Q&A
Register FAQ Calendar Mark Forums Read

Software Q&A Having trouble with software? Find solutions here


Closed Thread
 
LinkBack Thread Tools Display Modes
Old 05-10-2007, 12:39 PM   #1 (permalink)
Livin' in the ghetto
 
AshishSharma's Avatar
 
Join Date: May 2006
Location: Hmm .... Home
Posts: 309
Default Help : Renew IP


Hi Guys,

I've recently shifted to Reliance Broadband (Wimax) while the connection is good, getting connected is pain. It's nearly impossible to get the IP from their DHCP server on first connect and you have to do Ipconfig /renew for at least 15 - 20 minutes to get the IP. The worst part is to have to sit in front of the laptop doing ipconfig /renew again and again. Now while I bug the Reliance guys to fix this issue, I am trying to workaround it or atleast reduce the pain involved.

I hence though of scripting the IP renewal process, I did found a script which is close to what I need but then I've Vista and this script seems to be not completely for Vista. Here's the script:

@echo off
::
:: IPREPAIR.CMD - Attempt to repair the network connections
::
:: Written 12/16/03 by Rick Campbell
::

:: Determine what OS this script is running on.
if not "%OS%"=="Windows_NT" goto :end
ver | find "[Version 5" || goto :end

:: Clear environment variables
set dhcp=

:: Determine if client is dynamically or statically assigned an IP address
echo Determining if client is DHCP based...
for /f "tokens=3 delims= " %%d in (
''netsh int ip sh add ^| find /i "DHCP"''
) do (
set dhcp=%%d
)

:: If client is dynamic, then release and renew the IP address
if /i "%dhcp%"=="Yes" (
echo Client is using DHCP - Renewing the DHCP Address lease...
ipconfig /release > nul
ipconfig /renew > nul
) else (
echo Client is statically assigned - leaving address untouched...
)

:: Flush the ARP, NetBIOS, and DNS cache''s
echo Flushing the ARP Cache...
arp -d * > nul
echo Flushing the NetBIOS Cache...
nbtstat -R > nul
echo Flushing the DNS Cache...
ipconfig /flushdns > nul

:: Re-register the NetBIOS and Computer names with WINS and DNS
echo Re-registering the NetBIOS and Computer name with WINS and DNS...
nbtstat -RR > nul
ipconfig /registerdns > nul

goto :eof

:END
echo This script is to be run on Windows 2000/XP/2003 Only!



Can anyone help me alter this script for Windows Vista, also I am quite possibly doing it all wrong so if you have some suggestion on how to get this done. If there's some tool which should help me do this easily.

Most importantly the script should also check that it's not getting APIPA as the DHCP server tends to be unreachable for first couple of attempts.

~ Bump ~

Nobody here to help ?
__________________
~.~ Never argue with idiots, they just drag you down to their level then beat you with experience. ~.~

Last edited by AshishSharma; 05-10-2007 at 12:39 PM. Reason: Automerged Doublepost
AshishSharma is offline  
Advertisements. Register and be a member of the community to get rid of them.
Advertisement

Old 08-10-2007, 11:08 PM   #2 (permalink)
Right Off the Assembly Line
 
Join Date: Mar 2007
Posts: 4
Default Re: Help : Renew IP

Thanks man..i also have the same problem with reliance wimax. I've an xp system and i'll try this.
scorpio.in is offline  
Old 08-10-2007, 11:16 PM   #3 (permalink)
"The Cake is a Lie!!"
 
[xubz]'s Avatar
 
Join Date: Oct 2006
Posts: 471
Default Re: Help : Renew IP

Hey, I don't use vista, But I can help.

Can you run these commands and post them here?

ver
echo %OS%

And yeh, edit the post and put the script in [code] tags


Edit: Try this (You may need to run it as Admin)
Code:
@echo off
::
:: IPREPAIR.CMD - Attempt to repair the network connections
::
:: Written 12/16/03 by Rick Campbell
::

:: Determine what OS this script is running on.
if not "%OS%"=="Windows_NT" goto :end
ver | find "[Version 6" || goto :end

:: Clear environment variables
set dhcp=

:: Determine if client is dynamically or statically assigned an IP address
echo Determining if client is DHCP based...
for /f "tokens=3 delims= " %%d in (
''netsh int ip sh add ^| find /i "DHCP"''
) do (
set dhcp=%%d
)

:: If client is dynamic, then release and renew the IP address
if /i "%dhcp%"=="Yes" (
echo Client is using DHCP - Renewing the DHCP Address lease...
ipconfig /release > nul
ipconfig /renew > nul
) else (
echo Client is statically assigned - leaving address untouched...
)

:: Flush the ARP, NetBIOS, and DNS cache''s
echo Flushing the ARP Cache...
arp -d * > nul
echo Flushing the NetBIOS Cache...
nbtstat -R > nul
echo Flushing the DNS Cache...
ipconfig /flushdns > nul

:: Re-register the NetBIOS and Computer names with WINS and DNS
echo Re-registering the NetBIOS and Computer name with WINS and DNS...
nbtstat -RR > nul
ipconfig /registerdns > nul

goto :eof

:END
echo This script is to be run on Windows 2000/XP/2003 Only!
__________________
[xubz] ● http://xubz.com/
[steam_id] ● http://steamcommunity.com/id/xubz
[xubz] is offline  
Old 15-10-2007, 12:07 AM   #4 (permalink)
Livin' in the ghetto
 
AshishSharma's Avatar
 
Join Date: May 2006
Location: Hmm .... Home
Posts: 309
Default Re: Help : Renew IP

Thanks for helping me out with this issue guys.

I tried your modified script and got the following response :

On the command prompt :
__________________________________________________
C:\Users\sharashi\Desktop>renew-1.bat >output.txt
''netsh' is not recognized as an internal or external command,
operable program or batch file.
The ARP entry deletion failed: 87
__________________________________________________

In the output.txt file :
_____________________________________________
Microsoft Windows [Version 6.0.6000]
Determining if client is DHCP based...
Client is statically assigned - leaving address untouched...
Flushing the ARP Cache...
Flushing the NetBIOS Cache...
Flushing the DNS Cache...
Re-registering the NetBIOS and Computer name with WINS and DNS...
_________________________________________________
For the ver echo %OS% command I get the following output:

C:\Users\sharashi>ver echo %OS%

Microsoft Windows [Version 6.0.6000]

Hope this could take us somewhere
__________________
~.~ Never argue with idiots, they just drag you down to their level then beat you with experience. ~.~
AshishSharma is offline  
Closed Thread

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Renew IP address ...... making a bat file rahul_becks23 Software Q&A 14 23-01-2007 11:18 PM

 
Latest Threads
- by clmlbx
- by Charan
- by abhidev
- by Tenida
- by Niilesh
- by Who

Advertisement




All times are GMT +5.5. The time now is 07:53 PM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2012, vBulletin Solutions, Inc.

Search Engine Optimization by vBSEO 3.3.2