title: write file using WScript.shell
body: <p>How can I write text files using WScript I'm really new on this that's why I cannot give some details. I want to write a log file that can be stored in c://users/user/appdata/local</p>
  
  <p>my sample code, using FileSystemObject</p>
  
  <pre><code>function WriteFile() 
  {
     var fso  = new ActiveXObject("Scripting.FileSystemObject"); 
     var fh = fso.CreateTextFile("d:\\Test.txt", true); 
     fh.WriteLine("Some text goes here..."); 
     fh.Close(); 
  }
  
  &lt;body onload = "WriteFile();"&gt;
  &lt;/body&gt;
  </code></pre>
  
  <p>it does return in d: but in local c: it wont.</p>