Jump to content

Recommended Posts

Posted

I need to read the computer description of the local computer.  Looking around I see a lot about reading from AD, I don't need that.  Just the local computer description.  Thanks!

Posted (edited)

You can try WMI for example:

Local $oWMIService = ObjGet("winmgmts:\\" & @ComputerName & "\root\cimv2")
    If Not IsObj($oWMIService) Then Exit
   Local $oInstances = $oWMIService.ExecQuery("Select * from win32_operatingsystem")
   If IsObj($oInstances) Then
       For $oInstance In $oInstances
           ConsoleWrite($oInstance.Description & @CRLF)
       Next
    EndIf

Actually remembered you can get this from Registry as well

Local $sDescription = RegRead("HKLM\SYSTEM\CurrentControlSet\Services\LanmanServer\Parameters", "srvcomment")
MsgBox(4096, "Computer Description", @ComputerName & " = " & $sDescription)

 

Edited by Subz

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