-1
我正在嘗試創建一個註冊表項和子項,以便爲機器上的所有用戶啓用IE 11企業模式。這就是我目前使用的VBScript,它失敗的可怕(不添加密鑰)。我可以使用一些幫助來糾正這個問題。創建註冊表項(和子項)?
Const HKEY_LOCAL_MACHINE = &H80000002
strComputer = "."
Set ObjRegistry = _
GetObject("winmgmts:{impersonationLevel = impersonate}! \\" & _
strComputer & "\root\default:StdRegProv")
strPath = strKeyPath & "\" & strSubPath
strKeyPath = "Software\Policies\Microsoft"
strSubPath = "Internet Explorer\Main\EnterpriseMode"
strName = "Enabled"
ObjRegistry.CreateKey (HKEY_LOCAL_MACHINE, strPath)
ObjRegistry.SetStringValue HKEY_LOCAL_MACHINE, strPath, strName, strValue
MsgBox "Successfully enabled Internet Explorer Enterprise Mode."
End Function
嘗試在設置'strKeyPath'和'strSubPath'粘附這一行'strPath的= strKeyPath的& 「\」 &strSubPath'。目前你已經有了它,所以在你的'ObjRegistry.CreateKey'調用中使用'strPath'可能是NULL。 – JNevill
沒有這沒有解決我的問題,我得到了另一個錯誤。 「調用Sub時不能使用圓括號」 – blaq
你得到了什麼錯誤?你之前得到錯誤的地方? – JNevill