title: How to pass arguments to a WMI method via WMIC command line?
body: <p>I am trying to execute the <code>SetCustomShell</code> method from the <code>WESL_UserSetting</code> class using the WMIC command.  The class is in the non-default <code>\\root\StandardCimv2\Embedded</code> namespace in Windows 10 Enterprise.</p>
  
  <p>I already have the custom shell feature enabled, and I know the class is installed properly, because the command:</p>
  
  <pre><code>wmic /namespace:\\root\StandardCimv2\Embedded CLASS WESL_UserSetting CALL SetCustomShell /?
  </code></pre>
  
  <p>Produces this output:</p>
  
  <pre><code>Call                    [ In/Out ]Params&amp;type                         Status
  ====                    =====================                         ======
  SetCustomShell          [IN ]CustomReturnCodes(array of sint32)       Implemented
                          [IN ]CustomReturnCodesAction(array of sint32)
                          [IN ]DefaultAction(sint32)
                          [IN ]Shell(string)
                          [IN ]Sid(string)
                          [OUT]ReturnValue(uint32)
  </code></pre>
  
  <p>This also corresponds to <a href="https://docs.microsoft.com/en-us/windows-hardware/customize/enterprise/wesl-usersettingsetcustomshell" rel="nofollow noreferrer">Microsoft's documentation</a>, (except it lists the parameters are in a different order), so I <em>think</em> I'm on the right track here.  But I've tried to pass the arguments in a number of different ways, and <code>wmic</code> just doesn't seem to understand what I'm trying to do.</p>
  
  <p>I've tried named parameters (i.e. shell=xxx, Sid=xxx, etc.), enclosing the whole list in quotes, enclosing just the values in quotes, calling with parenthesis, and just blasting it with comma-separated values.  Nothing seems to work.  I always wind up with:</p>
  
  <pre><code>Invalid named parameter list.
  Hint: &lt;named param list&gt; ::= &lt;named param&gt; | &lt;named param&gt; &lt;named param list&gt; where &lt;named param&gt; ::= &lt;param name&gt;=&lt;param value&gt;
  </code></pre>
  
  <p>Or:</p>
  
  <pre><code>Invalid format.
  Hint: &lt;paramlist&gt; = &lt;param&gt; [, &lt;paramlist&gt;].
  </code></pre>
  
  <p>How do I call this method properly?</p>
  
  <p>Ironically, I know how to do this with a VBScript or PowerShell.  There are numerous examples on how to do this with a script in all sorts of languages.  But I need to execute it from a group policy or during an OS deployment without having to rely on a script file being available somewhere where the client can see it, and this <em>should</em> be something I can do with a single command.</p>