private static void CreateShortCut(string shortCutFile, string targetPath, string description = "")
{
var type = Type.GetTypeFromProgID("WScript.Shell");
object instance = Activator.CreateInstance(type);
var result = type.InvokeMember("CreateShortCut", BindingFlags.InvokeMethod, null, instance, new object[] { shortCutFile });
type = result.GetType();
type.InvokeMember("TargetPath", BindingFlags.SetProperty, null, result, new object[] { targetPath });
type.InvokeMember("Description", BindingFlags.SetProperty, null, result, new object[] { description });
type.InvokeMember("Save", BindingFlags.InvokeMethod, null, result, null);
}
private static void CreateSendToShortCut(string shortCutFileName, string targetPath, string description = "")
{
var sendToFolderPath = Environment.GetFolderPath(Environment.SpecialFolder.SendTo);
var shortCutFile = Path.Combine(sendToFolderPath, shortCutFileName);
CreateShortCut(shortCutFile, targetPath, description);
}</pre></div>