3

I need to create an option for all files that would run a batch file located in Windows directory or any other directory.

The batch file will basically delete the files and will also delete it from another server.

I have the batch file working just need the context menu option.

1 Answer 1

6

You have to create the following registry entries:

HKLM\Software\Classes\*\shell\yourappname
HKLM\Software\Classes\*\shell\yourappname\command

the first registry entry is a key, the second a string value. Set the value of the command entry to the path of your batch file, e.g. "c:\batch.bat %1"

The '%1' will get replaced by the path the context menu was shown for.

The '*' entry is for all files. If you want your menu to show up for folders/drives/whatever, you have to also add the same registry keys/values for those too, e.g.,

HKLM\Software\Classes\Folder\shell\yourappname
HKLM\Software\Classes\Folder\shell\yourappname\command
HKLM\Software\Classes\Directory\shell\yourappname
HKLM\Software\Classes\Directory\shell\yourappname\command
HKLM\Software\Classes\Drive\shell\yourappname
HKLM\Software\Classes\Drive\shell\yourappname\command
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.