Note that there are some explanatory texts on larger screens.

plurals
  1. POUnderstanding the WMI object path format
    text
    copied!<p>I want to write a class with similar funcionality as the .NET <a href="http://msdn.microsoft.com/en-us/library/1ktaf6fk.aspx" rel="nofollow"><code>ManagementPath</code></a> class. On <a href="http://msdn.microsoft.com/en-us/library/aa394566%28v=VS.85%29.aspx" rel="nofollow">MSDN</a> is a set of articles which handles the format of object paths. However, I don't understand it yet with all special cases</p> <ul> <li><p>String comparisons that deal with object paths are always case-insensitive. ==> does this also apply to the values of keys when querying for object instances?</p></li> <li><p>Hexadecimal constants for integers. ==> where can they occur? in values of keys only?</p></li> <li><p>Boolean constants for classes with keys that take Boolean values. ==> what are the constants? true / false? 0 / 1?</p></li> <li><p>An assumed local server with a partial namespace path. Thus, specifying the root and default namespace implies the root and default namespace on the local server. ==> does this <em>only</em> mean that if I don't specify a server, that then "." is used as server?</p></li> <li><p>No white space either within an element or between elements. ==> why does the original .NET implementation allow spaces in server names then?</p></li> <li><p>Embedded quotation marks in object paths are allowed but must delimit the quotation mark with escape characters, as in a C or C++ application. ==> ???</p></li> <li><p>Only decimal values are recognized as numeric portions of keys. ==> ???</p></li> <li><p>Everything on this page: <a href="http://msdn.microsoft.com/en-us/library/aa389223(v=VS.85).aspx" rel="nofollow">http://msdn.microsoft.com/en-us/library/aa389223(v=VS.85).aspx</a> ==> ?</p></li> </ul> <p>Well, the basic paths that I think are valid look like</p> <pre><code>\\Server\Namespace \Namespace \\Server\Namespace:Class \Namespace:Class Class \\Server\Namespace:Class.KeyName=KeyValue \Namespace:Class.KeyName=KeyValue Class.KeyName=KeyValue \\Server\Namespace:Class=KeyValue \Namespace:Class=KeyValue Class=KeyValue \\Server\Namespace:Class.FirstKey=FirstValue,SecondKey=SecondValue \Namespace:Class.FirstKey=FirstValue,SecondKey=SecondValue Class.FirstKey=FirstValue,SecondKey=SecondValue \\Server\Namespace:Class=@ \Namespace:Class=@ Class=@ as well as all combinations were the \\ is replaced by a // and/or the \ between server and namespace is replaced by / </code></pre> <p>Have I forgotten anything here?</p> <p>This is what can be extracted from MSDN. However, how may the individual tokens look like? This is what I <strong>think</strong> it may be:</p> <pre><code>KeyValue = "string" &lt;-- string 1 &lt;-- numeric 0x1 &lt;-- hex ?????????? &lt;-- about the "decimal value" thing and "embedded quitation mark" thing. Also, what about whitespaces? do they have to be abreviated by %20? KeyName / Class / Server = string without : or / or \ inside and maybe only [a-z0-9_] ? Namespace = string without : or / inside and maybe only [a-z0-9_\] (.NET implementation also buggy here. accepts forward slashes regardless of "You cannot use forward slashes within namespace names." on MSDN) Also, are they allowed to start with \ and end with a : ? </code></pre> <p>It would be very helpful if for each token a regular expression could be given of how it looks like.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload