I would like to replace certain part of IP Address in a batch file.
Lets say there is a variable
set ip=10.20.45.254
or
set ip=10.20.45.2
and i have to change the last part to 1 like
10.20.45.254 -> 10.20.45.1
I have tried to check this manual http://ss64.com/nt/syntax-replace.html but I am not sure how to detect exactly the last part of IP because it can have different length...
Is it possible todo?