Jump to content

WMI during unattended install


Recommended Posts

Hi all,

I have a VB script that I'm attempting to run at T-9 (via SetupParams in WINNT.SIF). I've simplified the script for readability:

FOR EACH Obj in GetObject("winmgmts:{impersonationLevel=impersonate}").InstancesOf("win32_WindowsProductActivation")

WScript.Echo Obj.ProductID

IF (Err <> 0) THEN

WScript.Echo Err.Description & ": 0x" & Hex(Err.Number)

END IF

NEXT

The script works just fine if run manually as a user, but it fails when run at T-9. The reason for failure is "Object required" (0x1A8).

After a bit of debugging, it seems that "Obj" does not return an object (I'm not really sure what it returns...but it certainly doesn't work).

After browsing these forums, I saw comments that WMI wasn't available at T-12/T-13. Is this also the case for T-9?

As a workaround, I can probably run the script via RunOnceEx...but it bugs me that I can't get this to work at T-9. Any other thoughts or clever tricks?

Link to comment
Share on other sites


Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...