Jump to content

Recommended Posts

Posted

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

Posted

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

Posted

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

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