Using WMI

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi
I wrote a program that use System.Management refrence to control hardware of
computer using WMI refrences.
I simply get the system information from the given classes of this
namespace, but how can I set a specific property like mouse double click time
or wallpaper or keboard properties, ...
I use both SetPropertyValue() method and Put() method but they didn't work.

Please tell me how can I do this.

Thanks in Advance
 
Mohammad,

Do you call the Put method on the object after you set the properties?
You need to do that to commit the changes you have made.

Hope this helps.
 
Yes I call the Put() method after I set the properties, but did not work.
Is there any other way to change hardware properties other than using WMI
refrences?

Nicholas Paldino said:
Mohammad,

Do you call the Put method on the object after you set the properties?
You need to do that to commit the changes you have made.

Hope this helps.


--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)

Mohammad-Reza said:
Hi
I wrote a program that use System.Management refrence to control hardware
of
computer using WMI refrences.
I simply get the system information from the given classes of this
namespace, but how can I set a specific property like mouse double click
time
or wallpaper or keboard properties, ...
I use both SetPropertyValue() method and Put() method but they didn't
work.

Please tell me how can I do this.

Thanks in Advance
 
Mohammad,

You could always call the APIs directly, but that's the point of WMI, to
abstract this stuff.

What are you trying to change?


--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)

Mohammad-Reza said:
Yes I call the Put() method after I set the properties, but did not work.
Is there any other way to change hardware properties other than using WMI
refrences?

Nicholas Paldino said:
Mohammad,

Do you call the Put method on the object after you set the
properties?
You need to do that to commit the changes you have made.

Hope this helps.


--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)

Mohammad-Reza said:
Hi
I wrote a program that use System.Management refrence to control
hardware
of
computer using WMI refrences.
I simply get the system information from the given classes of this
namespace, but how can I set a specific property like mouse double
click
time
or wallpaper or keboard properties, ...
I use both SetPropertyValue() method and Put() method but they didn't
work.

Please tell me how can I do this.

Thanks in Advance
 
What class and property?
Note that most of the properties of the cimv2 namespace classes are
Read-Only !! You are not supposed to change them!

Willy.
 
Back
Top