views:

121

answers:

1

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 wworking just need the context menu option.

Thanks.

+1  A: 

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
Stefan
Thank you very much.