title: Creating a shortcut to a folder in c#
body: <p>To make a long story short, I need to to create a shortcut to a folder using C#. I've been reading on using <code>IWshRuntimeLibrary</code>. When I go to try anything using <code>IWshRuntimeLibrary</code> I get all sorts of ambiguity errors with <code>System.IO.File</code>. I'm assuming this is because there is a <code>IWshRuntimeLibrary.File</code> interface along with <code>System.IO.File</code>. All I've really been able to find are articles on making shortcuts to apps, not folders.</p>
  
  <p>Ambiguity Errors aside:</p>
  
  <ul>
  <li>Is this the right tool to use for folder shortcuts?</li>
  <li>How do I create a shortcut using this</li>
  <li>How do I specify where the shortcut is placed</li>
  </ul>
  
  <p>Also when I try to create a shortcut to a folder, say <code>C:\TEMP</code> using this: </p>
  
  <pre><code>IWshShortcut shortcut;
  wshShell = new WshShellClass();
  shortcut = (IWshShortcut)wshShell.CreateShortcut(@"C:\TEMP");
  
  shortcut.TargetPath = @"C:\Documents and Settings";
  </code></pre>
  
  <p>I get a <code>COMException</code>. According to what I've read this should create a shortcut to the C drive temp folder and put the shortcut in the Documents and Settings.</p>