我使用这个 vbscript 从 Windows 更改 Bios 引导顺序设置:
function ErrCode(oReturn)
Dim strReturn
Select Case oReturn
Case 0 strReturn = "Success"
Case 1 strReturn = "Not Supported"
Case 2 strReturn = "Unspecified Error"
Case 3 strReturn = "Timeout"
Case 4 strReturn = "Failed"
Case 5 strReturn = "Invalid Parameter"
Case 6 strReturn = "Access Denied"
Case Else strReturn = "..."
End Select
ErrCode= strReturn
end function
Set objWMIService = GetObject("winmgmts:{impersonationlevel=impersonate}//./root/HP/InstrumentedBIOS")
Set colItems = objWMIService.ExecQuery("select * from HP_BIOSSettingInterface",,48)
For each objItem in colItems
objItem.SetBiosSetting oReturn, "Boot Order", "Network Controller,Hard Drive,ATAPI CD-ROM Drive" ,"<kbd/>"
if oReturn then
wscript.echo "Boot Order" & " Can not be set, Error=" & ErrCode(oReturn)
wscript.quit(oReturn )
end if
Next
它给了我错误消息 6: Access is denied。
此脚本适用于 HP DC7900 和我们拥有的其他 HP。我是本地管理员,我正在尝试使用 Windows 7 64 位。
有人可以帮帮我吗?为什么我会收到拒绝访问?