Page 1 of 1

script for increase ip

Posted: 20 Nov 2010 03:36
by techsitepoint
Hello.


I need a cmd script for increase ip, for example, if I have 192.168 .1.1 in a IP variable I need calculate 3 ip more, 192.168.1.4, in cmd, no vbs or similar.

Thanks

Example:

SET IP=192.168.1.1

I need calculate 192.168.1.4 , for example

Thanks

Re: script for increase ip

Posted: 20 Nov 2010 11:25
by !k

Code: Select all

@echo off
setlocal enableextensions enabledelayedexpansion
SET IP=192.168.1.1
for /f "tokens=1-4 delims=." %%a in ("%IP%") do (
set /a ddd = %%d + 3
SET newIP=%%a.%%b.%%c.!ddd!
echo !newIP!
)
pause