trying to create a new right-click menu command

Products and tips

Moderator: Site Mods

Post Reply
User avatar
pschroeter
Silver Member
Silver Member
Posts: 283
Joined: 2007 Jan 27, 00:46

trying to create a new right-click menu command

Post by pschroeter »

(Sorry if there is more info than you need in my description)

I was trying to create a new “Edit with Paint.NET” right-click menu item in Windows Explorer (which will show in xplorer²) for JPGs that opened them in PDN. I went to the control panel and opened Folder Options and the File Types tab. I clicked the Advanced button to open the Edit File Type dialog box.

I created a new action for JPG and called it “Edit with Paint.NET” in the Action: text box in the “Editing action for type: JPEG Image dialog.” I put the path to Paint.NET in the Application to perform action: text box. I tried the path with and without parenthesis. I tried adding a %1 variable. (I haven’t been able to figure our what this does I just saw it in a lot of the commands.) I notice Use DDE gets checked no matter what I do.

When I use my new command it opens Paint.NET but the program tells me “The image type is not recognized, and cannot be opened.” The program still can open JPGs in any of the various previous methods.

This is not important, but I am very curious why it doesn’t work and want to figure it out. I have reasons not to want to make opening JPGs with PDN the default action.
User avatar
nikos
Site Admin
Site Admin
Posts: 15806
Joined: 2002 Feb 07, 15:57
Location: UK
Contact:

Post by nikos »

try the same command as you have it in the registry from xplorer2 addressbar using > prompt, replacing %1 for $n (that's the name of the file to open) and see if it works
User avatar
pschroeter
Silver Member
Silver Member
Posts: 283
Joined: 2007 Jan 27, 00:46

Thank you for your help

Post by pschroeter »

nikos wrote:try the same command as you have it in the registry from xplorer2 addressbar using > prompt, replacing %1 for $n (that's the name of the file to open) and see if it works
Thank you for your help, but unfortunately that didn't work. I did stumble upon the magic combination that worked. It looks like this: "Path to Program" "%1". I had to enclose both the path and  the variable in quotes with a space between them.

By some magical coincidence I stumbled up a utility called FileTypeMan at http://www.nirsoft.net/utils/file_types_manager.html which replaces the Windows utility with an easier interface that had a Edit Action, Select From Running Programs feature which automatically formatted it properly.

I still don't know what %1 is. I've searched for it and I'm sure its another one of those powerful useful features that Microsoft like to hide.

People can think I'm lazy for wanting to save one click, but I'm thinking of the hundreds of repetitions that follow. Besides, I like to finesse things, which is why I use xplorer².

I've made, borrowed, or stoled all the custom toolbar icons I need for the Beta. I still wish changing icons could be done through the Customize Toolbar dialog.
narayan
Platinum Member
Platinum Member
Posts: 1430
Joined: 2002 Jun 04, 07:01

Post by narayan »

The quotes are required around the path only when there is a space somewhere in it.

For example, the following will work without quotes.
C:\FolderName\SubfolderName\ExecutableName.exe

But the following will need quotes:
C:\Folder Name\Subfolder Name\Executable Name.exe

HTH.
User avatar
johngalt
Gold Member
Gold Member
Posts: 561
Joined: 2008 Feb 10, 19:41
Location: 3rd Rock
Contact:

Post by johngalt »

IN addition to narayan's post, the %1 is a temporary variable that basically sits there waiting for input, and will usually use the filename that you have right clicked on as the input / replacement.  without it, it *may* work and it may not - depending upon the application- some apps automatically take input when starting, but others, such as Paint.NET, don't necessarily need a file to actually start, hence the use of the variable.

EDIT:  Added the following:

Funny, I went looking for a reference, and the first thing Google shows me is the post you made at Yahoo asking what it does...
Image

Image
Post Reply