title: Configuring IIS on the user's machine through code C#
body: <p>I configured a website to run locally on IIS for use on my machine. My desktop application has   something use with this locally running website for some operations.</p>
  
  <p>There are the steps I followed to configure the website<br/></p>
  
  <ol>
  <li><p>Use IIS Manager to configure a web application pointed at a directory. (C:\somefolder):<br/>
       Start > Internet Information Services (IIS) Manager.<br/>
       Expand the left-hand tree view and right-click on "Default Web Site".<br/>
       Select "Add Application".<br/>
       Set the "Alias" to "sampleweb"<br/>
       Click the "Select" button and choose the "ASP.NET 4.0" application pool.<br/>
       Set the "Physical path" to the directory - C:\somefolder.<br/>
       Click "OK".<br/></p></li>
  <li><p>Use IIS Manager to configure a virtual directory pointed at another directory (C:\somefiles).<br/>
       Start > Internet Information Services (IIS) Manager.<br/>
       Expand the left-hand tree view and right-click on "Default Web Site".<br/>
       Select "Add Virtual Directory".<br/>
       Set the "Alias" to "somefiles".<br/>
       Set the "Physical path" to the directory - C:\somefiles.<br/>
       Click "OK".<br/></p></li>
  </ol>
  
  <p>So, when I distribute the application, I want to be able to set up a local server on the user's machine, and perform the above stesp in IIS.<br/>
  I have been able to do the setting up of local server part, but I am confused with on how to perform the above stesp programmatically on the user's machine to get the website running.<br/>
  Any suggestions? I'm on <code>Windows 7</code> <code>64 bit</code> <code>IIS7</code></p>