#133021 - 2005-01-26 10:49 PM
Writing to the Reg
|
JoshW
Fresh Scripter
Registered: 2000-04-04
Posts: 31
Loc: Moline, Il 61265
|
Does anyone see an issue with this line?
WriteValue($HKLMVal + $Keyname + "\" + $ValueName, "MTU", "1300", "reg_dword")
Its part of this larger body. Everything works down to that WriteValue. If finds the right entry and just doesnt do the write.
$Index = 0 :Loop1 $HKLMVal = "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\Interfaces\" $KeyName = ENUMKEY($HKLMVal, $Index) If @ERROR = 0 ;;;;;;;;;; $Index2 = 0 :Loop2 $ValueName = ENUMVALUE($HKLMVal + $Keyname, $Index2) If @ERROR = 0 If $ValueName = "DhcpIPAddress" $VPNIP = ReadValue($HKLMVal + $Keyname,$ValueName) $ipsegment1 = Val(ltrim(SubStr($VPNIP, 1, 3))) $ipsegment2 = Val(ltrim(SubStr($VPNIP, 5, 3))) If $ipsegment1 = 192 If $ipsegment2 = 168 WriteValue($HKLMVal + $Keyname + "\" + $ValueName, "MTU", "1300", "reg_dword") ? "Path = " + $HKLMVal + $Keyname + "\" + $ValueName If @ERROR <> 0 ? "Value Not written to the registry" Endif EndIf EndIf EndIf $Index2 = $Index2 + 1 goto Loop2 Endif ;;;;;;;;;; $Index = $Index + 1 goto Loop1 Endif
_________________________
Josh
|
|
Top
|
|
|
|
Moderator: Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart
|
0 registered
and 507 anonymous users online.
|
|
|