okey....
here is the code. it changes just ip.
prob the mask has to be changed too. well, didn't test it, because only win98 machine I've found so far is one of the big boss'es and I don't dare to mess with them
code:
if 0 = exist("%temp%\ipchanged.tmp")
$baseip = "10.10.10"
$curip = @ipaddress
$newip = $baseip + "."+val(substr($curip,12,3))
$bkey = "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services"
$c = 0
$Reboot = 0
$KeyN = enumkey("$bkey\Class\NetTrans\",$c)
while @error = 0
$ip = ReadValue($bkey+"\Class\NetTrans\$KeyN","IPAddress")
if @error = 0 and $ip <> "0.0.0.0"
$ = writevalue($bkey+"\Class\NetTrans\$KeyN","IPAddress",$newip,"REG_SZ")
$Reboot = 1
endif
$c = $c +1
$KeyN = enumkey($bkey+"\Class\NetTrans\",$c)
loop
if $Reboot = 1
shell "%comspec% /c echo changed ip from $curip to $newip > %temp%\changed.tmp"
? "System needs to be restarted to establish new settings."
? ? " Press any key to proceed..." get $
run “%windir%\RUNDLL32.EXE user.exe,ExitWindows” exit
else
shell "%comspec% /c echo no changes done, current-ip $curip > %temp%\changed.tmp" endif
endif
so. it checks if it is ran on the machine before and does not run second time.
it also changes the ip, if it is existent.
it is also only for win98 machines, which means more testing on 95 and definetely not use it on winNT/2000
it can be checked by the kix macro @inwin:
if @inwin = 2
execute
endifcheers,