I have the following code below. I can't seem to get it to work for adding a folder to favorites. If I change it to specialfolders.desktop, it creates a shortcut on the desktop.
private void buttonAddFav_Click(object sender, EventArgs e)
{
string userName = System.Security.Principal.WindowsIdentity.GetCurrent().Name;
string targetPath = listFolderResults.SelectedItem.ToString();
var wsh = new IWshShell_Class();
IWshRuntimeLibrary.IWshShortcut shortcut = wsh.CreateShortcut(
Environment.GetFolderPath(Environment.SpecialFolder.Favorites) + "\\shorcut2.lnk") as IWshRuntimeLibrary.IWshShortcut;
shortcut.TargetPath = targetPath;
shortcut.Save();
}