title: Using ActiveX to get username
body: <p>I'm working with an old intranet site written in classic ASP.  I'm trying to retrieve their username they logged into their machine with.  Each user is logged into AD, but I can't retrieve it from the server since the intranet site does not use AD.</p>
  
  <p>I was told I could use ActiveX in order to retrieve it.  I did some research and I found the following code (javascript):</p>
  
  <pre><code>var wshshell = new ActiveXObject("WScript.shell");
  var username = wshshell.ExpandEnvironmentalStrings("%username%");
  </code></pre>
  
  <p>Currently I'm using IE8 and I get an "Automation server can't create object" error on that first line.</p>
  
  <p>1)  Any ideas why I'm getting the error?</p>
  
  <p>2)  Is there a better way to be doing this given my limitations?</p>