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

天涯浪子 提交于 2019-12-13 04:13:36

问题


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

回答1:


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



来源:https://stackoverflow.com/questions/12480435/vbscript-subroutine-to-check-ipv6-status-in-registry-returning-1

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!