title: Find %LocalAppData% path and add new folder with JavaScript
body: <p>I created a Windows 7 Gadget and I need to create a place on each user's computer to store the Settings.ini file (Created from my SettingsManager.js file). The application packaging team at my company recommends I use </p>
  
  <p>%LOCALAPPDATA%\Microsoft\Windows Sidebar\</p>
  
  <p>and then add</p>
  
  <p>Gadgets\iMon.Gadget\</p>
  
  <p>subfolders. This is so each user's settings are stored in a unique location and won't be changed by any other applications or gadgets. </p>
  
  <p>Do I need to use something along the lines of</p>
  
  <pre><code>var fso = new ActiveXObject("Scripting.FileSystemObject");
  var folder = fso.CreateFolder("path");
  </code></pre>
  
  <p>Any help on how to do this would be appreciated.</p>
  
  <p>Update: I found how to get the %localappdata% path, but I still need to create the new folder. Here's what I've tried without success:</p>
  
  <pre><code>var wshshell = new ActiveXObject("wscript.shell");
  var localAppData = wshshell.ExpandEnvironmentStrings("%localappdata%");
  var filePath = localAppData + "\\Microsoft\\Windows Sidebar\\Gadgets\\iMon.Gadget";
  var fso = new ActiveXObject("Scripting.FileSystemObject");
  var filePath = localAppData + "\\Microsoft\\Windows Sidebar\\Gadgets\\iMon.Gadget";
  </code></pre>