Jump to content

How to install WMIC in WinPE?


gbako

Recommended Posts

How does one (successfully) install WMIC into WinPE? I have tried to install wmic into both PE20 (Vista's PE) and PE30 (Win7's PE) with no success.

On both versions I found instructions on how to install the WMI package, and on both versions I was successful with this, but even after doing so, wmic does not work. I get error messages when using the app instead of the output I need.

I found an article on Technet where somebody has the same problem, and somebody replied a trick to fixing this (for WinPE3) was to copy the entire "c:\windows\system32\wbem" into your PE install, thus overwriting all the files that were in PE. Problem with idea, is that it does not fix anything.

If anybody has any ideas, I would greatly appreciate it. It does not matter if there is a solution for WinPE2 or WinPE3, either one is fine with me.

What I need WMIC.exe to work for is I need a WinPE CD to boot, and use wmic.exe to determine the type of hardware the system is running on, and then have a script make decisions based on the hardware you just booted on. This seems so simple, but without wmic.exe working, I'm stuck!

Thanks guys for any help you might be able to provide.

The article for installing a package into PE2 is here:

http://technet.microsoft.com/en-us/library/cc709665%28WS.10%29.aspx

The article for installing a package into PE3 is here:

http://technet.microsoft.com/en-us/library/dd799312%28WS.10%29.aspx

Problem is neither one of these articles was helpful, because while they do easily walk you thru the process of installing a package into PE2 or PE3, neither one explains why after you are done, wmic still does not properly work (even though the package install 100% successfully on both versions of PE)

George

Link to comment
Share on other sites


WMIC may make things easier, but if you have the Scripting package installed, you can use VBScript to work with the WMI.

Thanks, but I've already written several DOS batch files that rely wmic.exe, so I would like to stick with wmic.exe

Link to comment
Share on other sites

From here:

http://www.boot-land.net/forums/index.php?showtopic=9401

you should be able to get a reference for the dependencies. :unsure:

What happens if you just open a command prompt and run in it:

WMIC

Which exact error are you getting?

On a normal build the first time WMIC is run it "installs itself"

Is the WINMGMT service started (or can it be started)?

jaclaz

Link to comment
Share on other sites

From here:

http://www.boot-land.net/forums/index.php?showtopic=9401

you should be able to get a reference for the dependencies. :unsure:

What happens if you just open a command prompt and run in it:

WMIC

Which exact error are you getting?

On a normal build the first time WMIC is run it "installs itself"

Is the WINMGMT service started (or can it be started)?

jaclaz

The error I get in PE2 (Vista SP1's PE) is:

ERROR:

Code = 0x80040154

Description = Class not registered

Facility = Interface

If I use WinPE3 (Win7's PE), the error I get is:

ERROR:

Description = Invalid class string

Thats it. On both,the command I type in at the X:\ prompt is:

wmic csproduct

I use several other commands via wmic, but they all provide the exact error.

Nwo on both PE2 and PE3 I installed the WMI package, so the problem isn't that WMIC is missing. I found an article on technet where people had the same problem with PE3 (Win7's PE), and one person's solution was to take the entire C:\Windows\System32\wbem folder from Windows 7 and copy it into PE3's X:\Windows\System32\Wbem (in other words, overwriting the files in PE with the ones from Win7). I did this trick, and did nothing at all.

I don't know what else to do. It's a bit frustrating, as I'm not sure why this is ending up to be such a big deal to install!

Thanks for any help guys!

George

Link to comment
Share on other sites

wmic csproduct list /format:list works for me in both Win7(my computer) and WinPE 3.0 (in VirtualBox). Did you completely install WMI? Here is what I installed in my WinPE.

dism /image:C:\winpe_x86\mount /Add-Package /PackagePath:"C:\Program Files\Windows AIK\Tools\PETools\x86\WinPE_FPs\winpe-scripting.cab"

dism /image:C:\winpe_x86\mount /Add-Package /PackagePath:"C:\Program Files\Windows AIK\Tools\PETools\x86\WinPE_FPs\en-us\winpe-scripting_en-us.cab"

dism /image:C:\winpe_x86\mount /Add-Package /PackagePath:"C:\Program Files\Windows AIK\Tools\PETools\x86\WinPE_FPs\winpe-wmi.cab"

dism /image:C:\winpe_x86\mount /Add-Package /PackagePath:"C:\Program Files\Windows AIK\Tools\PETools\x86\WinPE_FPs\en-us\winpe-wmi_en-us.cab"

Link to comment
Share on other sites

Make_PE3 program will create PE with WMIC support.

Thanks for help guys. I found the issue was you needed more packages installed than just wmi and scripting.

I ended up also install the following packages:

XML

MDAC

HTA

So I basically installed 5 packages into PE (I used PE 2.1)

I doubt all 3 of these were needed, but with them installed wmic works correctly! I'm too lazy to go back right now and figure out which of these 3 packages is actually needed, but I will eventually. But for now, if you install the following 5 packages total under PE2, then wmic.exe will finally work correctly:

wmi

scripting

XML

MDAC

HTA

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...