Thursday, January 6, 2011

How to reset dynamic IP address?

code:--------------------------------------------------------------------------------
@ECHO OFF
%WINDIR%\system32\ipconfig /release
echo.
echo Ip-adress released  Make sure you wait about 5 minutes for someone to take your old IP-adress.
echo.
pause
%WINDIR%\system32\ipconfig /renew
echo.
echo Ip-adress renewed
echo.
pause
exit
--------------------------------------------------------------------------------

Explanation:
%WINDIR%\system32\ipconfig /release <-- tells command prompt to look for a program named ipconfig in your \system32 folder and start it with the option /release. (which releases your ip so other people can take it, and enables you to get a new one.)

%WINDIR%\system32\ipconfig /renew <-- tells command prompt the same as above, only with the option /renew. (which renews your IP-address hoping that someone took your old. @ECHO OFF <-- tells the command prompt to hide paths (Like C:\windows\system32\ipconfig /renew wont be shown on screen.) echo. <-- tells command promt to jump a line down without displaying any text or doing anything at all. echo <-- prints a message to the screen in command prompt.

pause <-- makes you have to press a key to continue with the script.

exit <-- exits command prompt.

No comments: