以编程方式移动快捷方式图标
在我的 Windows 7 PC 中,我安装了一些具有桌面快捷方式的应用程序。我的桌面有多个用户帐户。对于某些应用程序,我仅将快捷方式放置在我的管理桌面上。我希望其他用户也可以使用它们。所以我编写了一个程序,将管理桌面图标移动到公共桌面。我做了这样的事情:
File.Move(System.Environment.GetFolderPath(Environment.SpecialFolder.DesktopDirectory) + @"\MyShortcut.lnk", System.Environment.GetFolderPath(Environment.SpecialFolder.CommonDesktopDirectory) + @"\MyShortcut.lnk");
现在我在所有其他帐户中都可以看到这些快捷方式文件。它在管理员帐户中仍然运行良好。但在其他帐户中,它们不再像快捷方式那样表现。属性本身的快捷方式选项卡是看不到的(在其他帐户中)。我手动做了同样的事情,效果就像冠军一样。为什么以其他方式以编程方式完成相同的任务会发生这种情况?
In my Windows 7 PC, I have some applications installed which has desktop shortcuts. My desktop has multiple user accounts. For some applications I had shortcuts placed only on my admin desktop. I wanted them available for other users too. So I wrote a program that moves the admin desktop icon to public desktop. I did something like this:
File.Move(System.Environment.GetFolderPath(Environment.SpecialFolder.DesktopDirectory) + @"\MyShortcut.lnk", System.Environment.GetFolderPath(Environment.SpecialFolder.CommonDesktopDirectory) + @"\MyShortcut.lnk");
Now I have those shortcut files seen in all other accounts. It still works good in admin account. But in other accounts they no more behave like shortcut. The shortcut tab in properties itself is not seen (in other accounts). I did the same manually and it works like a champ. Why would this happen any other way to accomplish the same programmatically?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论