title: WMIC differences in Linux vs Windows
body: <p>This <code>wmic</code> query (<code>NODE</code>, <code>USER</code>, <code>PASS</code> all desensitised)...</p>
  
  <pre><code>wmic /NODE:10.00.00.1 /LOCALE:MS_409 /PRIVILEGES:ENABLE /TRACE:OFF /INTERACTIVE:OFF /FAILFAST:OFF /USER:domain\my_user /PASSWORD:myPass! /OUTPUT:STDOUT /APPEND:STDOUT /AGGREGATE:ON class StdRegProv CALL EnumKey ^&amp;H80000002,"Software\Microsoft\SystemCertificates\MY\Certificates"
  </code></pre>
  
  <p><code>^&amp;H80000002</code> is the uint32 conversion of <code>HKEY_LOCAL_MACHINE</code></p>
  
  <p>... runs flawlessly in a CMD prompt in Windows. I can also run it in the context of a node package from my local windows machine with success, I'm going to assume this is because the <code>wmic</code> call is made specifically to the local machine (windows) where it is handled effortlessly. Returning to me a result containing what I require...</p>
  
  <blockquote>
    <p>res.sNames [ 'BB731A3DD8F089A6D4E59AF9D706...' ]</p>
  </blockquote>
  
  <p>I created a docker container running Alpine and node where I host an express application. I followed the instructions below to install WMIC on Linux...</p>
  
  <p><a href="https://askubuntu.com/questions/885407/installing-wmic-on-ubuntu-16-04-lts">https://askubuntu.com/questions/885407/installing-wmic-on-ubuntu-16-04-lts</a></p>
  
  <p>This installed successfully.</p>
  
  <p>Now when I run the exact same query from a bash prompt in Ubuntu either via my Node app or a direct command, I'm receiving this result:</p>
  
  <blockquote>
    <p>Garne@MYCOMPUTERNAME MINGW64 ~
    $ wmic.exe /NODE:10.00.00.1 /LOCALE:MS_409 /PRIVILEGES:ENABLE /TRACE:OFF /INTERACTIVE:OFF /FAILFAST:OFF /USER:domain\my_user /PASSWORD:myPass! /OUTPUT:STDOUT /APPEND:STDOUT /AGGREGATE:ON class StdRegProv CALL EnumKey ^&amp;H80000002,"Software\Microsoft\SystemCertificates\MY\Certificates"</p>
    
    <p>[1] 426</p>
    
    <p>bash: H80000002,Software\Microsoft\SystemCertificates\MY\Certificates: No such file or directory</p>
    
    <p>Garne@MYCOMPUTERNAME MINGW64 ~ $ ERROR: Description = Access is
    denied.</p>
  </blockquote>
  
  <p>I can't for the life of me work out whether this is due to a string formatting error in Linux vs Windows or whether Linux is running a different variant of <code>wmic</code> that isn't resolving my query correctly?</p>