By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,968 Members | 1,843 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,968 IT Pros & Developers. It's quick & easy.

what's available in WMI

P: n/a
cj
I found this code online and it works fine but I don't understand
exactly how and am trying to. Can someone help me?

Public Class Form1
Inherits System.Windows.Forms.Form

#Region " Windows Form Designer generated code "

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
Dim t As Single
Dim WMIService, Computer As Object
WMIService =
GetObject("Winmgmts:{impersonationLevel=impersonat e,(Debug,Shutdown)}")
For Each Computer In
WMIService.InstancesOf("Win32_OperatingSystem")
t = Computer.Win32Shutdown(8 + 4, 0)
If t <> 0 Then
MsgBox("Error")
End If
Next
End Sub

#1 GetObject requires a file name or a class. As winmgmts is not a
file on my computer I assume it is a class. How can I view it? I
understand the impersonationlevel but not the debug, shutdown.

#2 when it says for each computer in WMIService.InstancesOf
("Win32_OperatingSystem") what other things can I get to instead of
win32_operating sytem? Where or how can I find out my other options?
Jun 1 '06 #1
Share this Question
Share on Google+
9 Replies


P: n/a
Actually this is the link I meant to post:
http://msdn.microsoft.com/library/en...ng06112002.asp

"cj" <cj@nospam.nospam> wrote in message
news:%2****************@TK2MSFTNGP02.phx.gbl...
I found this code online and it works fine but I don't understand exactly how
and am trying to. Can someone help me?

Public Class Form1
Inherits System.Windows.Forms.Form

#Region " Windows Form Designer generated code "

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
Dim t As Single
Dim WMIService, Computer As Object
WMIService =
GetObject("Winmgmts:{impersonationLevel=impersonat e,(Debug,Shutdown)}")
For Each Computer In WMIService.InstancesOf("Win32_OperatingSystem")
t = Computer.Win32Shutdown(8 + 4, 0)
If t <> 0 Then
MsgBox("Error")
End If
Next
End Sub

#1 GetObject requires a file name or a class. As winmgmts is not a file on
my computer I assume it is a class. How can I view it? I understand the
impersonationlevel but not the debug, shutdown.

#2 when it says for each computer in WMIService.InstancesOf
("Win32_OperatingSystem") what other things can I get to instead of
win32_operating sytem? Where or how can I find out my other options?

Jun 1 '06 #2

P: n/a
http://www.microsoft.com/technet/scr..._overview.mspx

"cj" <cj@nospam.nospam> wrote in message
news:%2****************@TK2MSFTNGP02.phx.gbl...
I found this code online and it works fine but I don't understand exactly how
and am trying to. Can someone help me?

Public Class Form1
Inherits System.Windows.Forms.Form

#Region " Windows Form Designer generated code "

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
Dim t As Single
Dim WMIService, Computer As Object
WMIService =
GetObject("Winmgmts:{impersonationLevel=impersonat e,(Debug,Shutdown)}")
For Each Computer In WMIService.InstancesOf("Win32_OperatingSystem")
t = Computer.Win32Shutdown(8 + 4, 0)
If t <> 0 Then
MsgBox("Error")
End If
Next
End Sub

#1 GetObject requires a file name or a class. As winmgmts is not a file on
my computer I assume it is a class. How can I view it? I understand the
impersonationlevel but not the debug, shutdown.

#2 when it says for each computer in WMIService.InstancesOf
("Win32_OperatingSystem") what other things can I get to instead of
win32_operating sytem? Where or how can I find out my other options?

Jun 1 '06 #3

P: n/a
cj
Been there done that. I can see the examples but beyond them is dark.
What else exists? How can I find out? Since that is VB script it
doesn't address the {impersonationlevel=impersonate, (debug, shutdown)}.
It doesn't even address Win32_OperatingSystem. But it does tell me
Win32_Service, Win32_Process, Win32_LogicalMemoryConfiguration and
Win32_NTLogEvent exist. I have to figure there are more. How can I
find out what they are and what they do? I ran those examples and if
they tell me I'm too dumb to understand. I also looked at WMI Scripting
Primer: parts 2 and 3 and still no help.
Mike Lowery wrote:
Actually this is the link I meant to post:
http://msdn.microsoft.com/library/en...ng06112002.asp

"cj" <cj@nospam.nospam> wrote in message
news:%2****************@TK2MSFTNGP02.phx.gbl...
I found this code online and it works fine but I don't understand exactly how
and am trying to. Can someone help me?

Public Class Form1
Inherits System.Windows.Forms.Form

#Region " Windows Form Designer generated code "

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
Dim t As Single
Dim WMIService, Computer As Object
WMIService =
GetObject("Winmgmts:{impersonationLevel=impersonat e,(Debug,Shutdown)}")
For Each Computer In WMIService.InstancesOf("Win32_OperatingSystem")
t = Computer.Win32Shutdown(8 + 4, 0)
If t <> 0 Then
MsgBox("Error")
End If
Next
End Sub

#1 GetObject requires a file name or a class. As winmgmts is not a file on
my computer I assume it is a class. How can I view it? I understand the
impersonationlevel but not the debug, shutdown.

#2 when it says for each computer in WMIService.InstancesOf
("Win32_OperatingSystem") what other things can I get to instead of
win32_operating sytem? Where or how can I find out my other options?


Jun 1 '06 #4

P: n/a
If your going to use wmi, wbemtest is a very handy
tool that comes with windows to find out what info you can get from cimv2
(all the win32 classes are listed there).
So I would also do some reading on wbemtest.

If you want I can send you and example app that uses wmi to get all sort of
pc info which I made a couple of months ago

you can mail me @ pproost at the google mail name (gmail.com)

--
Programming today is a race between software engineers striving to build
bigger and better idiot-proof programs, and the Universe trying to produce
bigger and better idiots. So far, the Universe is winning. (Rich Cook)

"cj" <cj@nospam.nospam> schreef in bericht
news:#y**************@TK2MSFTNGP02.phx.gbl...
Been there done that. I can see the examples but beyond them is dark.
What else exists? How can I find out? Since that is VB script it
doesn't address the {impersonationlevel=impersonate, (debug, shutdown)}.
It doesn't even address Win32_OperatingSystem. But it does tell me
Win32_Service, Win32_Process, Win32_LogicalMemoryConfiguration and
Win32_NTLogEvent exist. I have to figure there are more. How can I
find out what they are and what they do? I ran those examples and if
they tell me I'm too dumb to understand. I also looked at WMI Scripting
Primer: parts 2 and 3 and still no help.
Mike Lowery wrote:
Actually this is the link I meant to post:
http://msdn.microsoft.com/library/en...ng06112002.asp
"cj" <cj@nospam.nospam> wrote in message
news:%2****************@TK2MSFTNGP02.phx.gbl...
I found this code online and it works fine but I don't understand exactly how and am trying to. Can someone help me?

Public Class Form1
Inherits System.Windows.Forms.Form

#Region " Windows Form Designer generated code "

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
Dim t As Single
Dim WMIService, Computer As Object
WMIService =
GetObject("Winmgmts:{impersonationLevel=impersonat e,(Debug,Shutdown)}")
For Each Computer In WMIService.InstancesOf("Win32_OperatingSystem") t = Computer.Win32Shutdown(8 + 4, 0)
If t <> 0 Then
MsgBox("Error")
End If
Next
End Sub

#1 GetObject requires a file name or a class. As winmgmts is not a file on my computer I assume it is a class. How can I view it? I understand the impersonationlevel but not the debug, shutdown.

#2 when it says for each computer in WMIService.InstancesOf
("Win32_OperatingSystem") what other things can I get to instead of
win32_operating sytem? Where or how can I find out my other options?


Jun 1 '06 #5

P: n/a
cj
Hi Peter, actually I tried wbemtest yesterday. Way too many buttons.
Connection? Credentials? Locale? Then Enum Classes or instances or
namespaces? Classes I guess. Superclass name????? Whew! Method
Invocation Options????? I gave up to look for something that made more
sense to me. I found Scriptomatic today on a Microsoft web site but it
seems to show only settings and not methods.

I've been looking at

http://msdn.microsoft.com/library/de..._reference.asp
http://msdn.microsoft.com/library/de...em_classes.asp
http://msdn.microsoft.com/library/de...tingsystem.asp

for an hour or two now and while I find microsoft sites very confusing
I'm making headway. I can't seem to find the organization between the
pages and the pane on the left never seems to follow along as I click
links. But the stuff I'm looking for is in here somewhere. I have to
bookmark anything that looks interesting or I might not be able to find
it again.
Peter Proost wrote:
If your going to use wmi, wbemtest is a very handy
tool that comes with windows to find out what info you can get from cimv2
(all the win32 classes are listed there).
So I would also do some reading on wbemtest.

If you want I can send you and example app that uses wmi to get all sort of
pc info which I made a couple of months ago

you can mail me @ pproost at the google mail name (gmail.com)

--
Programming today is a race between software engineers striving to build
bigger and better idiot-proof programs, and the Universe trying to produce
bigger and better idiots. So far, the Universe is winning. (Rich Cook)

"cj" <cj@nospam.nospam> schreef in bericht
news:#y**************@TK2MSFTNGP02.phx.gbl...
Been there done that. I can see the examples but beyond them is dark.
What else exists? How can I find out? Since that is VB script it
doesn't address the {impersonationlevel=impersonate, (debug, shutdown)}.
It doesn't even address Win32_OperatingSystem. But it does tell me
Win32_Service, Win32_Process, Win32_LogicalMemoryConfiguration and
Win32_NTLogEvent exist. I have to figure there are more. How can I
find out what they are and what they do? I ran those examples and if
they tell me I'm too dumb to understand. I also looked at WMI Scripting
Primer: parts 2 and 3 and still no help.
Mike Lowery wrote:
Actually this is the link I meant to post:
http://msdn.microsoft.com/library/en...ng06112002.asp "cj" <cj@nospam.nospam> wrote in message
news:%2****************@TK2MSFTNGP02.phx.gbl...
I found this code online and it works fine but I don't understand exactly how and am trying to. Can someone help me?

Public Class Form1
Inherits System.Windows.Forms.Form

#Region " Windows Form Designer generated code "

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
Dim t As Single
Dim WMIService, Computer As Object
WMIService =
GetObject("Winmgmts:{impersonationLevel=impersonat e,(Debug,Shutdown)}")
For Each Computer In WMIService.InstancesOf("Win32_OperatingSystem") t = Computer.Win32Shutdown(8 + 4, 0)
If t <> 0 Then
MsgBox("Error")
End If
Next
End Sub

#1 GetObject requires a file name or a class. As winmgmts is not a file on my computer I assume it is a class. How can I view it? I understand the impersonationlevel but not the debug, shutdown.

#2 when it says for each computer in WMIService.InstancesOf
("Win32_OperatingSystem") what other things can I get to instead of
win32_operating sytem? Where or how can I find out my other options?


Jun 1 '06 #6

P: n/a
I thought those primers talked about using the wbem tool? (not going to go back
and look)

This tool should also help:
http://www.microsoft.com/technet/scr.../wmimatic.mspx

"cj" <cj@nospam.nospam> wrote in message
news:O4**************@TK2MSFTNGP05.phx.gbl...
Hi Peter, actually I tried wbemtest yesterday. Way too many buttons.
Connection? Credentials? Locale? Then Enum Classes or instances or
namespaces? Classes I guess. Superclass name????? Whew! Method Invocation
Options????? I gave up to look for something that made more sense to me. I
found Scriptomatic today on a Microsoft web site but it seems to show only
settings and not methods.

I've been looking at

http://msdn.microsoft.com/library/de..._reference.asp
http://msdn.microsoft.com/library/de...em_classes.asp
http://msdn.microsoft.com/library/de...tingsystem.asp

for an hour or two now and while I find microsoft sites very confusing I'm
making headway. I can't seem to find the organization between the pages and
the pane on the left never seems to follow along as I click links. But the
stuff I'm looking for is in here somewhere. I have to bookmark anything that
looks interesting or I might not be able to find it again.
Peter Proost wrote:
If your going to use wmi, wbemtest is a very handy
tool that comes with windows to find out what info you can get from cimv2
(all the win32 classes are listed there).
So I would also do some reading on wbemtest.

If you want I can send you and example app that uses wmi to get all sort of
pc info which I made a couple of months ago

you can mail me @ pproost at the google mail name (gmail.com)

--
Programming today is a race between software engineers striving to build
bigger and better idiot-proof programs, and the Universe trying to produce
bigger and better idiots. So far, the Universe is winning. (Rich Cook)

"cj" <cj@nospam.nospam> schreef in bericht
news:#y**************@TK2MSFTNGP02.phx.gbl...
Been there done that. I can see the examples but beyond them is dark.
What else exists? How can I find out? Since that is VB script it
doesn't address the {impersonationlevel=impersonate, (debug, shutdown)}.
It doesn't even address Win32_OperatingSystem. But it does tell me
Win32_Service, Win32_Process, Win32_LogicalMemoryConfiguration and
Win32_NTLogEvent exist. I have to figure there are more. How can I
find out what they are and what they do? I ran those examples and if
they tell me I'm too dumb to understand. I also looked at WMI Scripting
Primer: parts 2 and 3 and still no help.
Mike Lowery wrote:
Actually this is the link I meant to post:

http://msdn.microsoft.com/library/en...ng06112002.asp
"cj" <cj@nospam.nospam> wrote in message
news:%2****************@TK2MSFTNGP02.phx.gbl...
> I found this code online and it works fine but I don't understand

exactly how
> and am trying to. Can someone help me?
>
> Public Class Form1
> Inherits System.Windows.Forms.Form
>
> #Region " Windows Form Designer generated code "
>
> Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
> System.EventArgs) Handles Button1.Click
> Dim t As Single
> Dim WMIService, Computer As Object
> WMIService =
> GetObject("Winmgmts:{impersonationLevel=impersonat e,(Debug,Shutdown)}")
> For Each Computer In

WMIService.InstancesOf("Win32_OperatingSystem")
> t = Computer.Win32Shutdown(8 + 4, 0)
> If t <> 0 Then
> MsgBox("Error")
> End If
> Next
> End Sub
>
> #1 GetObject requires a file name or a class. As winmgmts is not a

file on
> my computer I assume it is a class. How can I view it? I understand

the
> impersonationlevel but not the debug, shutdown.
>
> #2 when it says for each computer in WMIService.InstancesOf
> ("Win32_OperatingSystem") what other things can I get to instead of
> win32_operating sytem? Where or how can I find out my other options?


Jun 1 '06 #7

P: n/a
cj
If they did I didn't get it. I know they mentioned it but I don't think
they explained it--well at least they didn't enough for me.

Yea, the scriptomatic tool is pretty good.

I think I'm ok for now. I appreciate the help Mike and Peter.

Mike Lowery wrote:
I thought those primers talked about using the wbem tool? (not going to go back
and look)

This tool should also help:
http://www.microsoft.com/technet/scr.../wmimatic.mspx

"cj" <cj@nospam.nospam> wrote in message
news:O4**************@TK2MSFTNGP05.phx.gbl...
Hi Peter, actually I tried wbemtest yesterday. Way too many buttons.
Connection? Credentials? Locale? Then Enum Classes or instances or
namespaces? Classes I guess. Superclass name????? Whew! Method Invocation
Options????? I gave up to look for something that made more sense to me. I
found Scriptomatic today on a Microsoft web site but it seems to show only
settings and not methods.

I've been looking at

http://msdn.microsoft.com/library/de..._reference.asp
http://msdn.microsoft.com/library/de...em_classes.asp
http://msdn.microsoft.com/library/de...tingsystem.asp

for an hour or two now and while I find microsoft sites very confusing I'm
making headway. I can't seem to find the organization between the pages and
the pane on the left never seems to follow along as I click links. But the
stuff I'm looking for is in here somewhere. I have to bookmark anything that
looks interesting or I might not be able to find it again.
Peter Proost wrote:
If your going to use wmi, wbemtest is a very handy
tool that comes with windows to find out what info you can get from cimv2
(all the win32 classes are listed there).
So I would also do some reading on wbemtest.

If you want I can send you and example app that uses wmi to get all sort of
pc info which I made a couple of months ago

you can mail me @ pproost at the google mail name (gmail.com)

--
Programming today is a race between software engineers striving to build
bigger and better idiot-proof programs, and the Universe trying to produce
bigger and better idiots. So far, the Universe is winning. (Rich Cook)

"cj" <cj@nospam.nospam> schreef in bericht
news:#y**************@TK2MSFTNGP02.phx.gbl...
Been there done that. I can see the examples but beyond them is dark.
What else exists? How can I find out? Since that is VB script it
doesn't address the {impersonationlevel=impersonate, (debug, shutdown)}.
It doesn't even address Win32_OperatingSystem. But it does tell me
Win32_Service, Win32_Process, Win32_LogicalMemoryConfiguration and
Win32_NTLogEvent exist. I have to figure there are more. How can I
find out what they are and what they do? I ran those examples and if
they tell me I'm too dumb to understand. I also looked at WMI Scripting
Primer: parts 2 and 3 and still no help.
Mike Lowery wrote:
> Actually this is the link I meant to post:
>
http://msdn.microsoft.com/library/en...ng06112002.asp
> "cj" <cj@nospam.nospam> wrote in message
> news:%2****************@TK2MSFTNGP02.phx.gbl...
>> I found this code online and it works fine but I don't understand
exactly how
>> and am trying to. Can someone help me?
>>
>> Public Class Form1
>> Inherits System.Windows.Forms.Form
>>
>> #Region " Windows Form Designer generated code "
>>
>> Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
>> System.EventArgs) Handles Button1.Click
>> Dim t As Single
>> Dim WMIService, Computer As Object
>> WMIService =
>> GetObject("Winmgmts:{impersonationLevel=impersonat e,(Debug,Shutdown)}")
>> For Each Computer In
WMIService.InstancesOf("Win32_OperatingSystem")
>> t = Computer.Win32Shutdown(8 + 4, 0)
>> If t <> 0 Then
>> MsgBox("Error")
>> End If
>> Next
>> End Sub
>>
>> #1 GetObject requires a file name or a class. As winmgmts is not a
file on
>> my computer I assume it is a class. How can I view it? I understand
the
>> impersonationlevel but not the debug, shutdown.
>>
>> #2 when it says for each computer in WMIService.InstancesOf
>> ("Win32_OperatingSystem") what other things can I get to instead of
>> win32_operating sytem? Where or how can I find out my other options?

Jun 1 '06 #8

P: n/a
cj,

Why don't you than not accept Peters offer to sent the program he made. I
think that most of us made such a kind of program. The one of my is to old
and probably to clumsy to make the same offer as Peter.

Remember for WMI that is is just a bunch of collections holding collections
which can hold collections again. If something does not exist can be because
the hard or software is just not giving the information that is needed
because it does not exist. Let say by instance a mainboard serial number.

I hope this helps,

Cor

"cj" <cj@nospam.nospam> schreef in bericht
news:O4**************@TK2MSFTNGP05.phx.gbl...
Hi Peter, actually I tried wbemtest yesterday. Way too many buttons.
Connection? Credentials? Locale? Then Enum Classes or instances or
namespaces? Classes I guess. Superclass name????? Whew! Method
Invocation Options????? I gave up to look for something that made more
sense to me. I found Scriptomatic today on a Microsoft web site but it
seems to show only settings and not methods.

I've been looking at

http://msdn.microsoft.com/library/de..._reference.asp
http://msdn.microsoft.com/library/de...em_classes.asp
http://msdn.microsoft.com/library/de...tingsystem.asp

for an hour or two now and while I find microsoft sites very confusing I'm
making headway. I can't seem to find the organization between the pages
and the pane on the left never seems to follow along as I click links.
But the stuff I'm looking for is in here somewhere. I have to bookmark
anything that looks interesting or I might not be able to find it again.
Peter Proost wrote:
If your going to use wmi, wbemtest is a very handy
tool that comes with windows to find out what info you can get from cimv2
(all the win32 classes are listed there).
So I would also do some reading on wbemtest.

If you want I can send you and example app that uses wmi to get all sort
of
pc info which I made a couple of months ago

you can mail me @ pproost at the google mail name (gmail.com)

--
Programming today is a race between software engineers striving to build
bigger and better idiot-proof programs, and the Universe trying to
produce
bigger and better idiots. So far, the Universe is winning. (Rich Cook)

"cj" <cj@nospam.nospam> schreef in bericht
news:#y**************@TK2MSFTNGP02.phx.gbl...
Been there done that. I can see the examples but beyond them is dark.
What else exists? How can I find out? Since that is VB script it
doesn't address the {impersonationlevel=impersonate, (debug, shutdown)}.
It doesn't even address Win32_OperatingSystem. But it does tell me
Win32_Service, Win32_Process, Win32_LogicalMemoryConfiguration and
Win32_NTLogEvent exist. I have to figure there are more. How can I
find out what they are and what they do? I ran those examples and if
they tell me I'm too dumb to understand. I also looked at WMI Scripting
Primer: parts 2 and 3 and still no help.
Mike Lowery wrote:
Actually this is the link I meant to post:

http://msdn.microsoft.com/library/en...ng06112002.asp
"cj" <cj@nospam.nospam> wrote in message
news:%2****************@TK2MSFTNGP02.phx.gbl...
> I found this code online and it works fine but I don't understand

exactly how
> and am trying to. Can someone help me?
>
> Public Class Form1
> Inherits System.Windows.Forms.Form
>
> #Region " Windows Form Designer generated code "
>
> Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
> System.EventArgs) Handles Button1.Click
> Dim t As Single
> Dim WMIService, Computer As Object
> WMIService =
> GetObject("Winmgmts:{impersonationLevel=impersonat e,(Debug,Shutdown)}")
> For Each Computer In

WMIService.InstancesOf("Win32_OperatingSystem")
> t = Computer.Win32Shutdown(8 + 4, 0)
> If t <> 0 Then
> MsgBox("Error")
> End If
> Next
> End Sub
>
> #1 GetObject requires a file name or a class. As winmgmts is not a

file on
> my computer I assume it is a class. How can I view it? I understand

the
> impersonationlevel but not the debug, shutdown.
>
> #2 when it says for each computer in WMIService.InstancesOf
> ("Win32_OperatingSystem") what other things can I get to instead of
> win32_operating sytem? Where or how can I find out my other options?


Jun 1 '06 #9

P: n/a
cj
I appreciate Peter's offer but I think I'm ok now.
Cor Ligthert [MVP] wrote:
cj,

Why don't you than not accept Peters offer to sent the program he made. I
think that most of us made such a kind of program. The one of my is to old
and probably to clumsy to make the same offer as Peter.

Remember for WMI that is is just a bunch of collections holding collections
which can hold collections again. If something does not exist can be because
the hard or software is just not giving the information that is needed
because it does not exist. Let say by instance a mainboard serial number.

I hope this helps,

Cor

"cj" <cj@nospam.nospam> schreef in bericht
news:O4**************@TK2MSFTNGP05.phx.gbl...
Hi Peter, actually I tried wbemtest yesterday. Way too many buttons.
Connection? Credentials? Locale? Then Enum Classes or instances or
namespaces? Classes I guess. Superclass name????? Whew! Method
Invocation Options????? I gave up to look for something that made more
sense to me. I found Scriptomatic today on a Microsoft web site but it
seems to show only settings and not methods.

I've been looking at

http://msdn.microsoft.com/library/de..._reference.asp
http://msdn.microsoft.com/library/de...em_classes.asp
http://msdn.microsoft.com/library/de...tingsystem.asp

for an hour or two now and while I find microsoft sites very confusing I'm
making headway. I can't seem to find the organization between the pages
and the pane on the left never seems to follow along as I click links.
But the stuff I'm looking for is in here somewhere. I have to bookmark
anything that looks interesting or I might not be able to find it again.
Peter Proost wrote:
If your going to use wmi, wbemtest is a very handy
tool that comes with windows to find out what info you can get from cimv2
(all the win32 classes are listed there).
So I would also do some reading on wbemtest.

If you want I can send you and example app that uses wmi to get all sort
of
pc info which I made a couple of months ago

you can mail me @ pproost at the google mail name (gmail.com)

--
Programming today is a race between software engineers striving to build
bigger and better idiot-proof programs, and the Universe trying to
produce
bigger and better idiots. So far, the Universe is winning. (Rich Cook)

"cj" <cj@nospam.nospam> schreef in bericht
news:#y**************@TK2MSFTNGP02.phx.gbl...
Been there done that. I can see the examples but beyond them is dark.
What else exists? How can I find out? Since that is VB script it
doesn't address the {impersonationlevel=impersonate, (debug, shutdown)}.
It doesn't even address Win32_OperatingSystem. But it does tell me
Win32_Service, Win32_Process, Win32_LogicalMemoryConfiguration and
Win32_NTLogEvent exist. I have to figure there are more. How can I
find out what they are and what they do? I ran those examples and if
they tell me I'm too dumb to understand. I also looked at WMI Scripting
Primer: parts 2 and 3 and still no help.
Mike Lowery wrote:
> Actually this is the link I meant to post:
>
http://msdn.microsoft.com/library/en...ng06112002.asp
> "cj" <cj@nospam.nospam> wrote in message
> news:%2****************@TK2MSFTNGP02.phx.gbl...
>> I found this code online and it works fine but I don't understand
exactly how
>> and am trying to. Can someone help me?
>>
>> Public Class Form1
>> Inherits System.Windows.Forms.Form
>>
>> #Region " Windows Form Designer generated code "
>>
>> Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
>> System.EventArgs) Handles Button1.Click
>> Dim t As Single
>> Dim WMIService, Computer As Object
>> WMIService =
>> GetObject("Winmgmts:{impersonationLevel=impersonat e,(Debug,Shutdown)}")
>> For Each Computer In
WMIService.InstancesOf("Win32_OperatingSystem")
>> t = Computer.Win32Shutdown(8 + 4, 0)
>> If t <> 0 Then
>> MsgBox("Error")
>> End If
>> Next
>> End Sub
>>
>> #1 GetObject requires a file name or a class. As winmgmts is not a
file on
>> my computer I assume it is a class. How can I view it? I understand
the
>> impersonationlevel but not the debug, shutdown.
>>
>> #2 when it says for each computer in WMIService.InstancesOf
>> ("Win32_OperatingSystem") what other things can I get to instead of
>> win32_operating sytem? Where or how can I find out my other options?

Jun 1 '06 #10

This discussion thread is closed

Replies have been disabled for this discussion.