CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2

Thread: WMI Help!!!

  1. #1
    Join Date
    Jan 2009
    Posts
    13

    Angry WMI Help!!!

    Hey all, when I try to set the following WMI property, I get the followng error: "Value out of range". I can successfully access the value but can't set it. I am trying to change the computer description. What am I doing wrong?

    Dim objEv As System.Management.ManagementObjectSearcher = New System.Management.ManagementObjectSearcher("SELECT * FROM Win32_OperatingSystem")
    For Each objMgmt As System.Management.ManagementObject In objEv.Get
    objMgmt("description") = value
    objMgmt.Put()
    Next

    whatever the value is ( for example "ASUS p5Q"), i get a "value out of range" exception when VS gets to the objMgmt.Put() function. And "description" isn't read-only according to MS.

    What is wrong with this code?

    Any help would be greatly appreciated. Thank you

  2. #2
    Join Date
    Jan 2006
    Location
    Fox Lake, IL
    Posts
    15,007

    Re: WMI Help!!!

    Download Scriptomatic by the Microsoft Scripting Guys to see if they do it any differently. Possibly the BIOS doesn't allow it
    David

    CodeGuru Article: Bound Controls are Evil-VB6
    2013 Samples: MS CODE Samples

    CodeGuru Reviewer
    2006 Dell CSP
    2006, 2007 & 2008 MVP Visual Basic
    If your question has been answered satisfactorily, and it has been helpful, then, please, Rate this Post!

Tags for this Thread

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

Featured