title: how to get wifi password from cmd with java
body: <p>I'm trying supply my wifi connection password with java. but I have to do it as an admin.</p>
  
  <pre><code>try {
      Process p = Runtime.getRuntime().exec("netsh.exe wlan show profiles name=superonline key=clear");
      BufferedReader bf = new BufferedReader(new InputStreamReader(p.getInputStream()));
      while (bf.readLine() != null)
          System.out.println(bf.readLine());
  } catch (Exception ex) {
      ex.printStackTrace();
  }
  </code></pre>
  
  <p>When I try it as a standard user:</p>
  
  <p><a href="https://i.stack.imgur.com/0VR4u.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/0VR4u.png" alt="enter image description here"></a></p>
  
  <p>When I try it as administrator:</p>
  
  <p>How can do this in java code?</p>
  
  <p><a href="https://i.stack.imgur.com/YmMJc.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/YmMJc.png" alt="enter image description here"></a></p>