我正在添加以下注册表项,以便将关闭选项添加到桌面上下文菜单:
[HKEY_CLASSES_ROOT\DesktopBackground\Shell\Shutdown]
"Icon"="shell32.dll,-28"
"MUIVerb"=hex(2):40,00,25,00,53,00,79,00,73,00,74,00,65,00,\
6D,00,52,00,6F,00,6F,00,74,00,25,00,5C,00,73,00,79,00,73,00,74,00,65,00,\
6D,00,33,00,32,00,5C,00,73,00,68,00,65,00,6C,00,6C,00,33,00,32,00,2E,00,\
64,00,6C,00,6C,00,2C,00,2D,00,33,00,33,00,32,00,38,00,30,00,00,00
"Position"="Bottom"
"SubCommands"=""
[HKEY_CLASSES_ROOT\DesktopBackground\Shell\Shutdown\Shell\001ShutdownInstantly]
"MUIVerb"=hex(2):40,00,25,00,53,00,79,00,73,00,74,00,65,00,\
6D,00,52,00,6F,00,6F,00,74,00,25,00,5C,00,73,00,79,00,73,00,74,00,65,00,\
6D,00,33,00,32,00,5C,00,73,00,68,00,65,00,6C,00,6C,00,33,00,32,00,2E,00,\
64,00,6C,00,6C,00,2C,00,2D,00,33,00,33,00,32,00,38,00,30,00,00,00
"Icon"="shell32.dll,-28"
[HKEY_CLASSES_ROOT\DesktopBackground\Shell\Shutdown\Shell\001ShutdownInstantly\command]
@="shutdown -sg -f -t 0"
[HKEY_CLASSES_ROOT\DesktopBackground\Shell\Shutdown\Shell\003RestartInstantly]
"MUIVerb"=hex(2):40,00,25,00,53,00,79,00,73,00,74,00,65,00,\
6D,00,52,00,6F,00,6F,00,74,00,25,00,5C,00,73,00,79,00,73,00,74,00,65,00,\
6D,00,33,00,32,00,5C,00,73,00,68,00,65,00,6C,00,6C,00,33,00,32,00,2E,00,\
64,00,6C,00,6C,00,2C,00,2D,00,33,00,33,00,32,00,38,00,31,00,00,00
"Icon"="shell32.dll,-16739"
[HKEY_CLASSES_ROOT\DesktopBackground\Shell\Shutdown\Shell\003RestartInstantly\command]
@="shutdown -g -f -t 0"
由于我使用的是 shell32.dll 的本地化字符串(十六进制扩展为“@%SystemRoot%\system32\shell32.dll,-33280”),因此只需放置一个与号(“&”或“&”)不起作用并打破了整个名字。
顺便说一句,我有另一个代码片段,我已经修改为使用 MUI,它自动使用下划线访问密钥,即使我不知道为什么:
[HKEY_CLASSES_ROOT\Directory\shell\cmd2admin]
@=hex(2):40,00,25,00,53,00,79,00,73,00,74,00,65,00,\
6D,00,52,00,6F,00,6F,00,74,00,25,00,5C,00,73,00,79,00,73,00,74,00,65,00,\
6D,00,33,00,32,00,5C,00,73,00,68,00,65,00,6C,00,6C,00,33,00,32,00,2E,00,\
64,00,6C,00,6C,00,2C,00,2D,00,33,00,37,00,34,00,34,00,34,00,00,00
"Icon"="cmd.exe"
"Extended"=""
[HKEY_CLASSES_ROOT\Directory\shell\cmd2admin\command]
@="PowerShell -windowstyle hidden -Command \"Start-Process cmd.exe -ArgumentList '/s,/k,pushd,%V' -Verb RunAs\""