复制快捷方式到桌面就可以,复制到开始,程序就不行,是不是系统有保护呀,要怎么作呀?哪位高手指点一下呀?
            string pathDeskTop = "C:" + "\\" + "Documents and Settings" + "\\" + "All Users" + "\\" + "桌面" + "\\" + "IT部门管理系统.lnk";
            string pathProgram = "Environment.GetFolderPath(Environment.SpecialFolder.Programs)" + "\\";
           // string pathProgram = "C:" + "\\" + "Documents and Settings" + "\\" + "All Users" + "\\" + " 「开始」菜单" + "\\" + "程序" + "\\" + "ITSys" + "\\";
                         CopyDirectory(Application.StartupPath + "\\", txtDSPath.Text);           
            //shortcut(_path);
            System.IO.File.Copy(Application.StartupPath + "\\" + "IT部门管理系统.lnk", pathDeskTop, true);
            System.IO.File.Copy(Application.StartupPath + "\\" + "IT部门管理系统.lnk", pathProgram, true);
            System.IO.File.Copy(Application.StartupPath + "\\" + "卸载.lnk", pathProgram, true);

解决方案 »

  1.   

    IWshShortcut 启动菜单
    string shortcutPath = "";   
    WshShell shell = new WshShell();   
    IWshShortcut shortcut = (IWshShortcut)shell.CreateShortcut(shortcutPath);   
    shortcut.TargetPath = Application.ExecutablePath;      
    shortcut.WorkingDirectory = System.Environment.CurrentDirectory;   
    shortcut.WindowStyle = 1;    
    shortcut.Description = "";   
    shortcut.IconLocation = Application.ExecutablePath + ",0";   
    shortcut.Save();   
      

  2.   

    未能找到路径“C:\Documents and Settings\All Users\ 「开始」菜单\程序\ITSys\卸载.lnk”的一部分。代码如下,我已在程序下面新建了一个ITSys文件夹。string pathProgram = "C:" + "\\" + "Documents and Settings" + "\\" + "All Users" + "\\" + " 「开始」菜单" + "\\" + "程序" + "\\" + "ITSys" + "\\" + "卸载.lnk"; System.IO.File.Copy(Application.StartupPath + "\\" + "卸载.lnk", pathProgram, true);
      

  3.   

    你直接把路径:C:\Documents and Settings\All Users\ 「开始」菜单\程序\ITSys\。。放到开始--运行-中看看能不能找到。有可能本身就访问不了这样,,,
      

  4.   

    C:\Documents and Settings\All Users\「开始」菜单\程序\ITSys
    开始那块有空格造成的。看来要想办法去掉它