简体   繁体   English

将文件拖放到快捷方式中,以路径为参数调用 CMD.EXE

[英]Drag and Drop a file into a shortcut to call a CMD.EXE with the path as a parameter

I like the Drag/Drop interface very much.我非常喜欢拖放界面。 Especially to start a simple command-line program from the command shell by dropping a file to a shortcut would be a nice feature (Shortcuts are dropping targets for dragged files).特别是从命令 shell 通过将文件拖放到快捷方式来启动一个简单的命令行程序将是一个不错的功能(快捷方式是拖放文件的目标)。

Unfortunately the shortcut doesn't call the command-line program with the path to the file dropped.不幸的是,快捷方式不会调用删除文件路径的命令行程序。

Dropping a file to such a shortcut only starts some kind of a window which disappears immediately.将文件拖放到这样的快捷方式只会启动某种 window,它会立即消失。 Using a shortcut to call a batch file executes the batch but does not append the dropped file as a path as a parameter.使用快捷方式调用批处理文件会执行批处理但不会将拖放的文件作为路径作为参数。

Any idea how to get a simple solution for this simple dropping target?知道如何为这个简单的放置目标找到一个简单的解决方案吗?

The problem of not getting the name of the file to drop is rather trivial: I had coded a CMD.EXE /k in the shortcut to execute the batch file.没有得到要删除的文件名的问题相当简单:我在快捷方式中编写了一个 CMD.EXE /k 来执行批处理文件。 After removing that and only coding the batch file it works flawlessly.删除它并仅对批处理文件进行编码后,它可以完美地工作。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM