VirtualBox

Opened 12 years ago

Closed 8 years ago

#10118 closed defect (obsolete)

“SWbemObjectEx: Access denied” error calling GetDWORDValue on guest VirtualBox machine

Reported by: john Owned by:
Component: guest control Version: VirtualBox 4.1.8
Keywords: vboxmanage guestcontrol execute Cc:
Guest type: Windows Host type: Windows

Description (last modified by aeichner)

Using "vboxmanage guestcontrol" to execute a .vbs script on guest machine which queries the registry with GetDWORDValue returns the error: "SWbemObjectEx: Access denied". Note: Occasionally, the error "Illegal operation attempted on a registry key that has been marked for deletion." will occur on the first attempt, and then the "SWbemObjectEx: Access denied" thereafter.

Guest Environment: Windows 7 or Vista. Is NOT a problem with Windows XP guest, at least for me.

Steps:

  1. Place 'test.vbs' script on Windows 7 or Windows Vista guest machine's desktop which uses "GetDWORDValue":
const HKEY_LOCAL_MACHINE = &H80000002
strComputer = "."
set oReg = GetObject("winmgmts:{impersonationLevel=impersonate}!\" & strComputer & "\root\default:StdRegProv")


strKeyPath = "SOFTWARE\test"
strValueName = "test"

oReg.GetDWORDValue HKEY_LOCAL_MACHINE,strKeyPath,strValueName,dwValue

msgbox dwValue
  1. while not logged into the guest machine via winlogon, run command from host,e.g.:
vboxmanage guestcontrol "Win7x86" execute --image "C:\windows\system32\cscript.exe" --wait-stderr --username testlogin --password mypassword -- "C:\Users\testlogin\Desktop\test.vbs"
  1. Note the error.
  1. log into the machine via winlogon screen, then run same command from step 2. Note no error.

I should be able to work around this by using other tool (e.g. sysinternals PsExec.exe) to run the script on the guest. If this is closed as by design or deferred for some other reason, I would still appreciate a your insight into why / how this is happening; I don't understand all the moving parts.

will attach vbox.log file on request.

Change History (1)

comment:1 by aeichner, 8 years ago

Description: modified (diff)
Resolution: obsolete
Status: newclosed

Please reopen if still relevant with a recent VirtualBox release.

Note: See TracTickets for help on using tickets.

© 2023 Oracle
ContactPrivacy policyTerms of Use