Results 1 to 3 of 3

Thread: Help file: thinBasic Modules > WMI > WMI_GetData

  1. #1
    Super Moderator Petr Schreiber's Avatar
    Join Date
    Aug 2005
    Location
    Brno - Czech Republic
    Posts
    7,128
    Rep Power
    732

    Help file: thinBasic Modules > WMI > WMI_GetData

    Hi,

    it seems the example code listed under thinBasic Modules > WMI > WMI_GetData uses wrong syntax. Here is modified version, which should work.

    Uses "WMI", "OS"
    Uses "CONSOLE"
    
    Dim vData()       As String
    Dim nItems        As Long
    Dim Counter       As Long
    Dim ComputerName  As String = OS_GetComputerName
    Dim sBuffer       As String
    
    ' -- Ask data to WMI system
    sBuffer = WMI_GetData(ComputerName, "", "", "", "CIM_LogicalDisk", "DeviceID = 'C:'" )
    
    'sBuffer = WMI_GetData(ComputerName, "", "", "", "Win32_StartupCommand", "", "Command" )
    'sBuffer = WMI_GetData(ComputerName, "", "", "", "CIM_LogicalDisk", "DeviceID = 'C:'", "Name, Size" )
    'sBuffer = WMI_GetData(ComputerName, "", "", "", "CIM_Battery")
    'sBuffer = WMI_GetData(ComputerName, "", "", "", "CIM_LogicalDisk")
    'sBuffer = WMI_GetData(ComputerName, "", "", "", "CIM_NetworkAdapter")
    'sBuffer = WMI_GetData(ComputerName, "", "", "", "Win32_StartupCommand")
    'sBuffer = WMI_GetData(ComputerName, "", "", "", "Win32_Processor")
    'sBuffer = WMI_GetData(ComputerName, "", "", "", "CIM_DiskDrive")
    'sBuffer = WMI_GetData(ComputerName, "", "", "", "Win32_BIOS")
    'sBuffer = WMI_GetData(ComputerName, "", "", "", "Win32_CodecFile")
    'sBuffer = WMI_GetData(ComputerName, "", "", "", "CIM_LogicalDisk")
                                                                       
    ' -- Parse returned data into single lines
    nItems = Parse( sBuffer, vData(), $CRLF) 
    
    '---Print lines                           
    For Counter = 1 To nItems                 
      Console_WriteLine vData(Counter)        
    Next                                      
    
    '---Finished                              
    Console_WriteLine "-----------------------------------------------------"
    Console_WriteLine "Number of lines: " & nItems                           
    Console_WriteLine "---------------------------Press a key to finish-----"    
    
    Console_WaitKey
    

    Petr
    Learn 3D graphics with ThinBASIC, learn TBGL!
    Windows 10 64bit - Intel Core i5-3350P @ 3.1GHz - 16 GB RAM - NVIDIA GeForce GTX 1050 Ti 4GB

  2. #2
    thinBasic author ErosOlmi's Avatar
    Join Date
    Sep 2004
    Location
    Milan - Italy
    Age
    57
    Posts
    8,777
    Rep Power
    10
    A bit late but next update will have this example amended.

    Thanks
    Eros
    www.thinbasic.com | www.thinbasic.com/community/ | help.thinbasic.com
    Windows 10 Pro for Workstations 64bit - 32 GB - Intel(R) Xeon(R) W-10855M CPU @ 2.80GHz - NVIDIA Quadro RTX 3000

  3. #3
    Super Moderator Petr Schreiber's Avatar
    Join Date
    Aug 2005
    Location
    Brno - Czech Republic
    Posts
    7,128
    Rep Power
    732
    Thanks a lot!
    Learn 3D graphics with ThinBASIC, learn TBGL!
    Windows 10 64bit - Intel Core i5-3350P @ 3.1GHz - 16 GB RAM - NVIDIA GeForce GTX 1050 Ti 4GB

Similar Threads

  1. Help file: TBASS_SampleLoad
    By Petr Schreiber in forum Fixed or cleared errors in help material
    Replies: 1
    Last Post: 14-12-2020, 22:34
  2. Help file: TBASS_SampleGetChannel
    By Petr Schreiber in forum Fixed or cleared errors in help material
    Replies: 0
    Last Post: 15-05-2011, 11:59
  3. Help file: TBASS_MusicLoad
    By Petr Schreiber in forum Fixed or cleared errors in help material
    Replies: 0
    Last Post: 15-05-2011, 11:48
  4. Help file: TBASS_MusicFree
    By Petr Schreiber in forum Fixed or cleared errors in help material
    Replies: 0
    Last Post: 15-05-2011, 11:36

Members who have read this thread: 0

There are no members to list at the moment.

Posting Permissions

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