问题
I'm trying to determine the computer model (e.g., "Optiplex 9010") in a batch script running in the context of Windows PE 3.1. When running Windows proper, I can do this using wmic csproduct
or wmic bios
but neither of these return any data when running Windows PE. (This also seems to be true of most or all other classes.)
I've already installed the winpe-wmi.cab
package to support WMI. Using wmic path
instead of an alias makes no difference.
How can I make my wmic
commands work?
回答1:
It turns out that most wmic
commands, including both wmic csproduct
and wmic bios
, will work if you install the winpe-scripting.cab
package in addition to the winpe-wmi.cab
package.
来源:https://stackoverflow.com/questions/35617451/how-can-i-use-wmic-in-a-windows-pe-script