title: Get windows user name using javascript
body: <p><strong>I tried to get the windows user name in IE browser only using the below code.</strong></p>
  
  <pre><code>function GetUserName() 
  { 
      var wshell = new ActiveXObject("WScript.Shell"); 
      alert(wshell.ExpandEnvironmentStrings("%USERNAME%")); 
  } 
  </code></pre>
  
  <p><strong>How to get the windows username in other browsers like chrome, mozilla, safari.</strong></p>