将文件拖动到桌面快捷方式 - 不打开文件中的应用文件、拖动、快捷方式、桌面

由网友(我没有勇气去翻开那本书)分享简介:我有一个小的日志查看器应用程序读取一些自定义日志。我可以直接将文件拖动到可执行文件,并且他们通过命令行装载就好了。I've got a small log viewer app to read some custom logs. I can drag files directly onto the executabl...

我有一个小的日志查看器应用程序读取一些自定义日志。我可以直接将文件拖动到可执行文件,并且他们通过命令行装载就好了。

I've got a small log viewer app to read some custom logs. I can drag files directly onto the executable, and they are loaded through the command line just fine.

但是,如果我将文件拖动到桌面快捷方式,Windows将不能打开使用这些文件作为命令行参数的应用程序。它不会打开应用程序都没有。

However, if I were to drag the files to a desktop shortcut, Windows will not open the application using the files as the command line arguments. It won't open the application at all.

有我丢失的东西?

这是在Windows 7企业版x64,不与任何提升的权限运行。这是所有写在C#,.NET 4.0客户端框架,等等。

This is on Windows 7 Enterprise x64, not running with any elevated privileges. This is all written in C#, .NET 4.0 Client framework, etc.

推荐答案

是您的桌面快捷方式的的公布捷径?不能拖放到一个广告快捷方式。如果您正在使用WiX的或Visual Studio安装项目来创建.msi安装的应用程序,那么它可能是其中的Windows安装程序为您创建桌面快捷方式是一个宣传的快捷方式。此外,你可以告诉一个快捷方式是否做广告,用鼠标右键单击它,查看属性,并查看目标字段是否显示为灰色。如果是,则发布。一种方法prevent这是设置的 DISABLEADVTSHORTCUTS 属性,这是一个Windows安装程序性能。设置此属性将禁用所有标榜的快捷键为您的应用程序。

Is your desktop shortcut an advertised shortcut? You cannot drag and drop onto an advertised shortcut. If you are using WiX or the Visual Studio Setup Projects to create a .msi installer for your application, then it's possible that your desktop shortcut which the Windows Installer is creating for you is an advertised shortcut. Also, you can tell whether or not a shortcut is advertised, by right-clicking it, viewing properties, and seeing whether or not the Target field is grayed out. If it is, then it is advertised. One way to prevent this is to set the DISABLEADVTSHORTCUTS property, which is a Windows Installer property. Setting this property will disable all advertised shortcuts for your application.

要设置或测试,这是用的逆戟鲸,并与1到属性表中的值添加属性名为DISABLEADVTSHORTCUTS,然后尝试重新安装。

The simplest way to set or test this is to open the .msi file with Orca, and add a property named DISABLEADVTSHORTCUTS with a value of 1 to the Property table, then try installing it again.

阅读全文

相关推荐

最新文章