我需要实现一个工具,所以我可以右键单击Windows文件资源pipe理器中的.RAR文件,附加的上下文菜单项将启动rar.exe文件作为命令行命令的参数。 输出文本应该传送到Windows剪贴板。
我知道有很多操作Windows资源pipe理器上下文菜单的教程,但没有一个跳到我作为解决scheme。 此外,具有特殊字符的批处理命令的语法让我感到困惑!
rar.exe的默认主目录是C:\ Program Files \ WinRAR \ rar.exe命令是rar.exe L [t,b] file | clip 或 rar.exe V [t,b]文件| 夹
环境:
Windows 7家庭高级版
只有批处理命令,没有其他语言。
这些是我们在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
所以他们中的一个可以
rar -v etc rar -vt etc rar -vb etc
从我的网站 注意\\
为\
和\"
为"
。 这也是Windows 98.使用CMD.exe
而不是NT上的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-Dos提示窗口中查看选项。 使用Set config.sys或autoexec.bat设置默认选项,即,
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\"> Prn