title: How to run windows cmd command "query session" in processbuilder in Java?
body: <p>This is what I am trying</p>
  
  <p><code>ProcessBuilder pb = new ProcessBuilder("cmd.exe", "/c", "\"query &amp;&amp; session\"");</code> </p>
  
  <p>but I get the error:</p>
  
  <pre><code>'query' is not recognized as an internal or external command,
  operable program or batch file.
  </code></pre>
  
  <p>What I am doing wrong here?</p>