2

Using the registry I used the following code below to create a sub-menu in the windows context menu.

[HKEY_CLASSES_ROOT\DesktopBackground\Shell\Power Menu]
"MUIVerb"="Matt's Usefull Tools"
"SubCommands"="batmode;logoff;switch;sleep;hibernate;restart;safemode;shutdown;hybridshutdown"
"Icon"="C:\\Users\\Matthew\\Downloads\\Hacker.ico"
"Position"="bottom"

Now I want to be able to click a command I set and then have it create a .bat file where I right clicked, I know you can add this to the "New" sub menu by editing the ".bat" registry using the code.

[HKEY_CLASSES_ROOT\.bat\ShellNew]
 "NullFile"=""

Now is it possible to implement this into my sub-menu?

4

1 回答 1

1

我只能通过以下命令来使用它:CMD.exe /c @ECHO.>"%V\New File.bat"

在 HKLM\Software\Microsoft\Windows\CurrentVersion\Explorer\CommandStore\Shell\batfile\command 下

其中“batfile”必须是您的“子命令”之一。

问题是,这将始终在当前位置(例如桌面)创建“New File.bat”。如果有一个现有的“New File.bat”,它只会覆盖它。如果您使用 CMD.exe /c @ECHO.>>"%V\New File.bat" 并且存在“New File.bat”的现有副本,它只会在文件中添加空格。

我不知道从“命令”调用“ShellNew”的方法。:/

也许它无论如何都有帮助。

编辑:哎呀......刚刚看到这是一个一岁的问题^。^无论如何 - 它可能对其他人有所帮助。:)

于 2014-11-06T07:28:26.507 回答