AshishSharma
Livin' in the ghetto
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 ?
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 ?
Last edited: