0

I'm trying to add a context menu command to change folder icon into my target icon, what am I doing wrong?

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 Answer 1

0

If I interpreting the registry dump properly you are trying to cram a lot of commands in a single menu item. You can't do that, you have to put all that commands in a command script (a batch file), for example IconExtract.cmd, and use that file as the command of the context menu item.

Also I wouldn't touch the key that you trying to use, I think that it's for internal configuration of Explorer, the proper key for adding commands to the context menu of a folder is HKEY_CLASSES_ROOT\Directory\shell, if would be something like this:

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"

and IconExtract.cmd would be:

"%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"

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .