Envin
Envin

Reputation: 1523

VBScript subroutine to check IPv6 status in registry...returning -1

I have this subroutine in my script and it is returning -1 as the value of strIPV6Status when the value is actually 0xfffffff in hexadecimal.

Any ideas why this is happening?

'**************************************************************************
'IP Address Configuration: Check if ipv6 is disabled
'**************************************************************************
Sub CheckIPV6()
   WScript.Echo("Check if IPv6 is disabled")
   WScript.Echo("------------------------------------")
   Const strIPV6Key = "SYSTEM\CurrentControlSet\services\TCPIP6\Parameters\"
   strValueName = "DisabledComponents"
   Set objRegistry = GetObject("winmgmts:\\" & strComputer & "\root\default:StdRegProv")
   objRegistry.GetDWORDValue HKEY_LOCAL_MACHINE, strIPV6Key,strValueName,strIPV6Status
   WScript.Echo(strIPV6Key & strValueName & " = " & strIPV6Status & vbCrLf)

End Sub

Upvotes: 0

Views: 978

Answers (1)

David W
David W

Reputation: 10184

Not sure what the problem is...believe 0xffffffff is the hex representation for -1 (signed 32-bit int)

Upvotes: 1

Related Questions