英文:
Getting the selected files path from a custom application in context menu
问题
I have a scenario where I keep copying a bunch of files to the same folder and if it exists, I rename the original file there and copy the files. I want to automate this process.
我有一个情景,我不断地将一堆文件复制到同一个文件夹,如果已存在,则重命名原文件并复制文件。我想自动化这个过程。
I was checking if I can add a context menu option which shows on right-click in Windows.
我正在检查是否可以添加一个右键单击时显示的上下文菜单选项在Windows中。
I followed a few tutorials which had given me a way to add a program to the context menu by modifying regkeys.
我按照一些教程的步骤,这些教程提供了一种通过修改注册表键来将程序添加到上下文菜单的方法。
But that just starts the program, I wanted to know how to get the paths of the items selected for copy to. Is there a way to achieve this? Or am I going down a wrong path?
但那只是启动程序,我想知道如何获取所选要复制的项目的路径。有没有办法实现这个?或者我走错了路?
I have added this command to the context menu with my program's exe as value.
我已经将这个命令添加到上下文菜单中,并使用我的程序exe作为值。
I want to know how to get the paths of selected items in my program.
我想知道如何在我的程序中获取所选项目的路径。
英文:
I have a scenario where I keep copying a bunch of files to same folder and if it exists, I rename the original file there and copy the files. I want to automate this process.
I was checking if I can add a context menu option which shows on right-click in Windows.
I followed few tutorials which had gave me a way to add a program to the context menu by modifying regkeys.
But that just starts the program, I wanted to know how to get the paths of the items selected for copy to. Is there a way to achieve this? Or am I going down a wrong path?
I have added this command to context menu with my programs exe as value.
I want to know how to get the paths of selected items in my program.
答案1
得分: 0
"PathToExe.exe" "%1". This passes the selected folder/file full as the first argument.
英文:
I found the answer for this.
When adding regkey for the context menu command specify it as following
"PathToExe.exe""%1". This passes the selected folder/file full as the first argument
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论