thx lonkero, but it seems not to work
so i wrote this; it works good:
code:
:winnt
if 0=exist("%windir%\ipchanged.tmp")
$bkey="HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters"
$NewIP="255.255.0.0."
$c=0
$Reboot = 0
$KeyN = enumkey("$bkey\Interfaces\",$c)
while @error = 0
$ip = ReadValue($bkey+"\Interfaces\$KeyN","SubnetMask")
if @error = 0 and $ip <> "0.0.0.0"
$ = writevalue($bkey+"\Interfaces\$KeyN","SubnetMask",$newIP,"REG_MULTI_SZ")
$Reboot = 1
endif
$c = $c +1
$KeyN = enumkey($bkey+"\Interfaces\",$c)
loop
if $Reboot = 1
shell "%comspec% /c echo changed ip from 255.255.255.0 to 255.255.0.0 > %windir%\ipchanged.tmp"
? "SubnetMask Changed"
? ? " Press any key to quit..." get $
SHUTDOWN ("","Redemarrage",5,1,1)
else
shell "%comspec% /c echo no changes done > %windir%\ipchanged.tmp"
endif
endif