Results 1 to 6 of 6

Thread: [2.0] Wmi?

  1. #1

    Thread Starter
    Frenzied Member
    Join Date
    Sep 2005
    Posts
    1,547

    [2.0] Wmi?

    So I no that you can access the data with the ManagementClass. But can you set data? Like can you set the fan speed? If you can, how?

  2. #2
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: [2.0] Wmi?

    Not that I've ever used it but the ManagementClass class has a Put method that MSDN describes as:
    Commits the changes to the object.
    I would assume that after setting properties of your local object you can call Put to commit the changes to the OS.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

  3. #3

    Thread Starter
    Frenzied Member
    Join Date
    Sep 2005
    Posts
    1,547

    Re: [2.0] Wmi?

    Hm,
    http://msdn.microsoft.com/en-us/libr...79(VS.85).aspx

    How would you access the lower classes(like CIM)?

    Would be nicer if .net had a Class to access WMI instead of queries. (I guess ManagementClass is that, but it still uses queries doesn't it?)

    Also would you use WMI to get the network devices mac address?

  4. #4
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: [2.0] Wmi?

    You might want to look at the MgmtClassGen utility although, from memory, you still just create an instance of the generated class by passing an instance of ManagementClass that was created by executing a query. That's basically the only way to use WMI, just as SQL is really the only way to access a database. Anything else is just a layer on top of SQL, so you could create your own layer on top of WMI queries if you wanted.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

  5. #5

    Thread Starter
    Frenzied Member
    Join Date
    Sep 2005
    Posts
    1,547

    Re: [2.0] Wmi?

    Quote Originally Posted by jmcilhinney
    You might want to look at the MgmtClassGen utility although, from memory, you still just create an instance of the generated class by passing an instance of ManagementClass that was created by executing a query. That's basically the only way to use WMI, just as SQL is really the only way to access a database. Anything else is just a layer on top of SQL, so you could create your own layer on top of WMI queries if you wanted.
    O so is WMI itself a database?

  6. #6
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170

    Re: [2.0] Wmi?

    WMI isn't a database, it's what it reads and manipulates that is presented to you as a database.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width