title: HP Elite 8300 SFF - Change Bios Boot Order WMI
body: <p>I use this vbscript to change Bios Boot Order settings from Windows:</p>
  
  <pre><code>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=impersonat​e}//./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"  ,"&lt;kbd/&gt;"
      if oReturn then
          wscript.echo "Boot Order" &amp; " Can not be set, Error="  &amp; ErrCode(oReturn)
          wscript.quit(oReturn )
      end if
  Next
  </code></pre>
  
  <p>It gives me error message 6: <strong>Access is denied</strong>.</p>
  
  <p>This script works great with HP DC7900 and other HP that we have. I'm Local Administrator and I'm trying with Windows 7 64-bit.</p>
  
  <p>Can someone please help me? Why do I get Access Denied?</p>