![.exe 的上下文菜单文件夹图标](https://linux22.com/image/1541840/.exe%20%E7%9A%84%E4%B8%8A%E4%B8%8B%E6%96%87%E8%8F%9C%E5%8D%95%E6%96%87%E4%BB%B6%E5%A4%B9%E5%9B%BE%E6%A0%87.png)
我正在尝试添加一个上下文菜单命令来将文件夹图标更改为我的目标图标,我做错了什么?
icon.exe = http://www.rw-designer.com/batch-icon-extractor
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\exefile\shell\IconExtract]
@="Icon2Folder"
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\CommandStore\shell\IconExtract\command]
@="cmd.exe /c "%AppData%\Variable\icon.exe" "%1""
@="cmd.exe /c ping 127.0.0.1 -n 3 > nul"
@="cmd.exe /c attrib -h -r "%1\desktop.ini"
@="cmd.exe /c echo [.ShellClassInfo] >"%1\desktop.ini"
@="cmd.exe /c echo IconFile="%AppData%\Variable\icons\*.ico>>"%1\desktop.ini"
@="cmd.exe /c echo IconIndex=0 >>"%1\desktop.ini"
@="cmd.exe /c attrib +h +r \"%1\desktop.ini"
@="cmd.exe /c attrib +r "%1"
@="cmd.exe /c rd /s /q "%AppData%\Variable\icons\*.ico""
答案1
如果我正确解释注册表转储,您正试图将大量命令塞入单个菜单项中。您无法做到这一点,您必须将所有命令放在命令脚本(批处理文件)中,然后IconExtract.cmd
将该文件用作上下文菜单项的命令。
另外,我不会触碰您尝试使用的键,我认为它是用于 Explorer 的内部配置,用于将命令添加到文件夹的上下文菜单的正确键是HKEY_CLASSES_ROOT\Directory\shell
,如果是这样的:
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\Directory\shell\IconExtract]
@="Title of the menu item"
[HKEY_CLASSES_ROOT\Directory\shell\IconExtract\command]
@="\"C:\\Path to the command script\\IconExtract.cmd\" %1"
并且IconExtract.cmd
将是:
"%AppData%\Variable\icon.exe" "%1"
ping 127.0.0.1 -n 3 > nul
attrib -h -r "%1\desktop.ini"
echo [.ShellClassInfo] >"%1\desktop.ini"
echo IconFile="%AppData%\Variable\icons\*.ico>>"%1\desktop.ini"
echo IconIndex=0 >>"%1\desktop.ini"
attrib +h +r \"%1\desktop.ini"
attrib +r "%1"
rd /s /q "%AppData%\Variable\icons\*.ico"