#37212 - 2003-03-03 02:56 PM
Re: Checking for REG_MULTI_SZ (multi-string) values
|
jarhead
Fresh Scripter
Registered: 2003-02-28
Posts: 16
|
quote: If $DefaultGateway = "169.112.1.1" AND $SubnetMask = "255.255.255.0"
I tried that before and it doesn't work. I think it may have something to do with the fact that the value is REG_MULTI_SZ. If I run this script... $DefaultGateway = ReadValue("HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\El90x1\Parameters\Tcpip", "DefaultGateway") $SubnetMask = ReadValue("HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\El90x1\Parameters\Tcpip", "SubnetMask") $lmhosts = ReadValue("HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\NetBT\Parameters", "EnableLMHOSTS") If @ERROR = 0 ? "Default Gateway: $DefaultGateway" ? "SubnetMask: $SubnetMask" Endif
I get this output (notice the "pipe" at the end of the value... Default Gateway: 169.112.1.2| SubnetMask: 255.255.255.0|
If I run what you suggested... $DefaultGateway = ReadValue("HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\El90x1\Parameters\Tcpip", "DefaultGateway") $SubnetMask = ReadValue("HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\El90x1\Parameters\Tcpip", "SubnetMask") If @ERROR = 0 If $DefaultGateway = "169.112.1.1" AND $SubnetMask = "255.255.255.0" ? "Default Gateway: $DefaultGateway" ? "SubnetMask: $SubnetMask" EndIf Endif
I get no output.
|
|
Top
|
|
|
|
Moderator: Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart
|
0 registered
and 302 anonymous users online.
|
|
|