Sign in to follow this  
Followers 0
damon

VistaPE and WMI not playing nice

6 posts in this topic

First Question, Is there a plugin that I need to allow WMI to work in VistaPE environment? Hours and hours of searching brought me to a no conclusion. but I feel that there has to be.

Here is the problem. using a simple script that i got off of the forums that pulls model. The reason I got it is because it works.tested

$computer = '.'
$wbemFlagReturnImmediately = 0x10
$wbemFlagForwardOnly = 0x20
$oWMIService = ObjGet('winmgmts:\\' & $computer& '\root\CIMV2')
If IsObj($oWMIService) Then
$colItems = $oWMIService.ExecQuery('SELECT * FROM Win32_ComputerSystem', 'WQL', $wbemFlagReturnImmediately + $wbemFlagForwardOnly)
If IsObj($colItems) Then
For $oItem In $colItems
    $model = $oItem.Model
Next
EndIf
EndIf


MsgBox (0,"",$model)

works on XP and Windows7. But VistaPE I get an ERROR

--------------------------------------------------------------------

--Line 13 (File "H:\test2.exe"):

--Error: Variable used without being declared

--------------------------------------------------------------------

I started with using the ScriptoMatic tool and thought maybe it was outputing the wrong code, but truely I have searched for this answer for about 5 days and I keep coming up without an answer.

thanks in advance for any help.


It always amazes me how one little thing can cause so much havoc

Share this post


Link to post
Share on other sites



I do not think so, and I think that is the problem. I have looked all over the msdn technet to find out how to start the service or what I need to do, and I have not found the answer yet.


It always amazes me how one little thing can cause so much havoc

Share this post


Link to post
Share on other sites

I am thinking that winmgmt should be the service that needs started. It is not on the vistape disk, and I have copied it from win7 but of course I can not start the service because it says that the service name is invalid.

I am using

net start winmgmt.exe

to try and start the service with no luck.... Any Clues?


It always amazes me how one little thing can cause so much havoc

Share this post


Link to post
Share on other sites

you have to add WMI package manually in WinPE

http://technet.microsoft.com/en-us/library/cc709665(WS.10).aspx

Share this post


Link to post
Share on other sites

you have to add WMI package manually in WinPE

http://technet.microsoft.com/en-us/library/cc709665(WS.10).aspx

Nice link.

;)


Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law

Share this post


Link to post
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
Sign in to follow this  
Followers 0