Jump to content

Need help coding windows context menu entry

Long story short I use a program for work and it is driving me crazy that they changed the way it works and I can not change it back. The program is Eraser https://eraser.heidi.ie/download/ and it is a military grade file erasure program I'm required to use as we deal with sensitive legal blah blah blah. It used to just be: Right click > Erase, but now it is: Right click > Eraser > Erase and if possible I would like to just add Erase back to my context menu.

I followed a guide online and went to: HKEY_CLASSES_ROOT\*\shell
And right clicked it creating a new key: HKEY_CLASSES_ROOT\*\shell\Erase
Then right clicked on it and created a new key named "command" and double clicked the "default" value and typed "C:\\Program Files\\Eraser\\Eraser.exe %1"

And it still didn't work. Can anyone please tell me what I'm doing wrong? The command shows up so it must be the "default" value code is not working as intended. Also bonus points if you can tell me how to get the eraser icon to show up next to the context menu entry. Thanks a million for helping me with this!

Link to comment
https://linustechtips.com/topic/689466-need-help-coding-windows-context-menu-entry/
Share on other sites

Link to post
Share on other sites

Maybe it's just a typo in the post, but did you write "\"s twice in the actual key? If you did that may be the reason it doesn't work.

 

Also, are you absolutely sure that is the correct path and executable name, with the correct capitals?

Don't ask to ask, just ask... please 🤨

sudo chmod -R 000 /*

Link to post
Share on other sites

Just now, Sauron said:

Maybe it's just a typo in the post, but did you write "\"s twice in the actual key? If you did that may be the reason it doesn't work.

 

Also, are you absolutely sure that is the correct path and executable name, with the correct capitals?

The post specifically said to use double backslashes, I thought that was strange as well. And yes I'm very sure that is the correct filepath with the correct capitalizations.

Link to post
Share on other sites

Just now, Wolf_Lbh said:

The post specifically said to use double backslashes, I thought that was strange as well. And yes I'm very sure that is the correct filepath with the correct capitalizations.

stackoverflow seems to disagree on the backslashes, try with a single one. Also include the "s if you haven't.

Don't ask to ask, just ask... please 🤨

sudo chmod -R 000 /*

Link to post
Share on other sites

18 minutes ago, elpiop said:

try

"C:\Program Files\Eraser\Eraser.exe" "%1"

as the value

That seemed to work better. Instead of asking me which program I want to use with the file, it now opens up a command prompt box and says that eraser didn't know what to do with the file.

Link to post
Share on other sites

12 hours ago, Wolf_Lbh said:

That seemed to work better. Instead of asking me which program I want to use with the file, it now opens up a command prompt box and says that eraser didn't know what to do with the file.

well then my guess is the executable requires additional parameters rather than just running it directly on a file.

Link to post
Share on other sites

1 hour ago, elpiop said:

Also, to add the icon: In the Eraser key, add a new string value like I have done. Name it "Icon" and specify the path to the executable. It will use the same icon as the exe

 

icon.PNG

 

 

I did that and restarted explorer using taskmanager and it still hasn't updated.

Actually is there a way to just set it to use a .ico file? Trying to get it to use this image as a .ico file: http://findicons.com/icon/158288/trash_recyclebin_empty_closed_w

Link to post
Share on other sites

1 hour ago, Wolf_Lbh said:

I did that and restarted explorer using taskmanager and it still hasn't updated.

Actually is there a way to just set it to use a .ico file? Trying to get it to use this image as a .ico file: http://findicons.com/icon/158288/trash_recyclebin_empty_closed_w

Sorry, not sure how to do that. However, when I set the icon it updates instantly without needing to restart anything. Perhaps someone else who knows more about this can offer help. 

Link to post
Share on other sites

5 minutes ago, elpiop said:

Sorry, not sure how to do that. However, when I set the icon it updates instantly without needing to restart anything. Perhaps someone else who knows more about this can offer help. 

OHHHH. I put the icon string in the command folder derp.

Edit: also just putting the path to the icon file in the value for the icon string will have it use that! Now I just need to figure out how to get the command working and everything is perfect.

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×