我需要实现一个工具,这样我就可以在中右键单击一个.RAR文件,一个附加的上下文菜单项将以该文件作为命令行命令的参数启动rar.exe。输出文本应以管道方式输入窗口剪贴板。
我知道有很多用于操作Windows上下文菜单的教程,但是没有一个是作为解决方案的。另外,带有特殊字符的批处理命令的语法让我感到困惑!
rar.exe的默认主页是C:\Program-Files\WinRAR\rar.exe,命令是rar.exe Lt,b文件x剪贴器或rar.exe Vt,b文件x剪贴器。
环境:
Windows 7,家庭高级版
只有批处理命令,没有其他语言。
发布于 2015-04-15 09:01:16
这是我们在Windows中的标准。
下表描述用于指示命令行语法的符号。
Notation Description
Text without brackets or braces
Items you must type as shown
<Text inside angle brackets>
Placeholder for which you must supply a value
[Text inside square brackets]
Optional items
{Text inside braces}
Set of required items; choose one
Vertical bar (|)
Separator for mutually exclusive items; choose one
Ellipsis (…)
Items that can be repeated所以v中的一个可以是
rar -v etc
rar -vt etc
rar -vb etc从我的网站上。注:\\表示\,\"表示"。这也是windows 98。在NT上使用CMD.exe而不是command.com。
打印目录清单
此注册表文件将向上下文菜单中添加一项,以便文件目录打印或列出目录中的所有文件或目录。
若要将命令添加到上下文菜单以打印目录列表,请执行以下操作。
REGEDIT4
[HKEY_CLASSES_ROOT\Directory\shell\Print\Command]
@="command.com /c dir \"%1\"> Prn若要将命令添加到上下文菜单以将目录列表打印到桌面上的文件中,请执行以下操作。
REGEDIT4
[HKEY_CLASSES_ROOT\Directory\shell\List\Command]
@="command.com /c dir \"%1\"> c:\\windows\\desktop\\Dirlist.txt"单>替换文件,而双>则添加到文件中。清单的格式将由dircmd环境设置或在命令行的dir之后添加开关来确定。
Dir /型?在MS提示符窗口中查看选项。使用config.sys或autoexec.bat中的Set设置默认选项,即,
Set DIRCMD=/a /v /l /4如果使用DIRCMD环境变量,则在其前缀加上连字符以关闭。下一个reg文件只打印目录和子目录,没有详细(/v)设置。
REGEDIT4
[HKEY_CLASSES_ROOT\Directory\shell\Print Tree\Command]
@="command.com /c dir /-v /a:d /s \"%1\"> Prnhttps://stackoverflow.com/questions/29642625
复制相似问题