1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

WMIQUERY query

Discussion in 'Support' started by vefatica, Sep 18, 2016.

  1. vefatica

    Joined:
    May 20, 2008
    Messages:
    7,970
    Likes Received:
    30
    Is an empty line between returned values expected? It's not particularly convenient (for something like DO /P). If I use "/B" I get two empty lines.
    Code:
    v:\> wmiquery /a . "select processid from win32_process"
    0
    
    4
    
    272
    
    400
    
    <snip>
     
  2. rconn

    rconn Administrator
    Staff Member

    Joined:
    May 14, 2008
    Messages:
    9,869
    Likes Received:
    83
    WAD - WMIQUERY is enumerating the properties of each object, and then displays a blank line before before enumerating the next object. In this case, you only have one property per object, but you wouldn't be very happy if you had multiple properties and they were not differentiated between objects.

    (WMIQUERY has always behaved this way.)
     
  3. vefatica

    Joined:
    May 20, 2008
    Messages:
    7,970
    Likes Received:
    30
    That makes sense. Perhaps a future version will omit the extra line when only one property is queried.
    Code:
    v:\> wmiquery /a . "select processid,caption from win32_process"
    Caption = System Idle Process
    ProcessId = 0
    
    Caption = System
    ProcessId = 4
    
    Caption = smss.exe
    ProcessId = 272
     

Share This Page