_jd_ Posted November 24, 2005 Posted November 24, 2005 The majority of my images these days are built using sysprep, which has provenquite valuable. I'm now looking to enhance my images by way of post-clone scriptsthat perform additional installations based on machine make/model or some otherhardware information. I'm aiming to use WMI for this task.I've spent some time on this project and i've hit a snag. It appears that during themini-setup process, when Cmdlines.txt is processed, the WMI information is eithernot yet populated or otherwise unavailable. Can anyone confirm the availability ofWMI at this time?I did a bit of troubleshooting today and have confirmed that during mini-setup theWMI service (winmgmt) and related services are running, I am able to connect tothe appropriate namespace (root\cimv2) and I can enumerate the class that I wishto query (Win32_ComputerSystem). Unfortunately, it appears that there's eithernot yet an instance of that class or I can't access the instance... I simply receiveand error (0x8004100a) which is simly listed as an "internal, critical and unexpectederror".Thoughts? I realize this is somewhat involved, but i'm not yet frustrated enoughto call/pay MS for support.Thanks.
InTheWayBoy Posted November 25, 2005 Posted November 25, 2005 Well, as a round about, couldn't you move the execution of the WMI script to after the setup has completed. I don't even know what a WMI script is, so lets use a batch as an example. Using various methods, you could insert the batch into the first startup. I would assume by then that the WMI info would be filled with the units info, as at that point it's fully loaded. And, if you positioned it to run first above all else, you could use the results to effect the next running tasks. So if you don't want a certain application to run if it matches a WMI result, then it would remove it from the list. The nice thing about this would be that you could leave most enabled, and then use results from the WMI script to limit the commands to precisely what you want.Of course there is more work to test and configure that way, but just in case you can't get any WMI info during mini-setup...good luck!
fizban2 Posted November 25, 2005 Posted November 25, 2005 JD, you are right, wmi is not available to use until windows is fully installed, you can set you wmi script to run from the RUNONCE section of your syspreped image, one windows starts for the first time your script will fire off and setup what you want, what are you exactly looking are you looking for the script to do?
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now