0

我有一个批处理文件,它使用7-Zip命令行实用程序将目录中的所有文件夹存档。

这是批处理文件,如果您想对其进行测试

@echo
cmd.exe /c for /D %%d in (*.*) do "C:\Program Files\7-Zip\7z.exe" a -t7z -r "%%d.7z" "%%d"
pause

这对我来说是一个非常有用的脚本,但是每次我希望这样做时都必须将批处理文件复制到目录中是相当耗时的。

我希望我可以添加一个上下文菜单条目(如“在此处打开命令提示符”或“ TakeOwnership ”),这将允许我右键单击一个目录并运行此命令:

for /D %%d in (*.*) do "C:\Program Files\7-Zip\7z.exe" a -t7z "%d.7z" "%d

我在使用注册表项命令语法时遇到了问题,因此无法成功地将其实现到上下文菜单中。

有什么建议么?

4

1 回答 1

1

Try looking at this page:
http://msdn.microsoft.com/en-us/library/windows/desktop/cc144175%28v=vs.85%29.aspx#shortcut_add_commands

It might help a bit, but I dont think it is going to the direction you want to.

I'm also trying to add something to the context menu, and it needs to give an argument to the program being called.

In that article, it does show applications taking arguments, but it puts the registry data in a (for me, third) part of the registry. I wouldnt be so hesitant against this, but the example I am following (Notepad++) doesnt have any entry here, so...

If I find out anything new, I'll drag it over here.

于 2013-10-29T22:05:25.780 回答