[GH-ISSUE #161] [FEATURE] Set default options for context menu #158

Closed
opened 2026-02-25 21:32:46 +03:00 by kerem · 4 comments
Owner

Originally created by @Dysterkind on GitHub (Dec 22, 2022).
Original GitHub issue: https://github.com/clechasseur/pathcopycopy/issues/161

Originally assigned to: @clechasseur on GitHub.

Hi,

maybe there is already some possiblity - unfortunately I wasn't able to find anything for the following request:

Is it somehow possible to alter the default shown options in the context menu right at the installation process (regardless of the user, I will be installing the application for "all users").

I would be in need to alter the selectable shown Options not to default, advanced nor power-user layout but simply to just show only one entry without submenu, "Copy Long UNC Path" - with the extra Option "Add Quotes..." "...only if paths contain spaces".

My initial thought was to use the Export/Import Settings feature but somehow I could not find any how to automate such an import when installing the application on another computer?

Thank you in advance!

/Dorian

Seems to point in the directory of a request already posted- so I'll reference it here:

    hi there, cmd options would be great so that i could use this with deployment packs, yes the installer has them but it would be great to have some for in example importing a configuration while deploying the tool within network

Originally posted by @SnkrLifeAndStyle in https://github.com/clechasseur/pathcopycopy/issues/80#issuecomment-886632753

Originally created by @Dysterkind on GitHub (Dec 22, 2022). Original GitHub issue: https://github.com/clechasseur/pathcopycopy/issues/161 Originally assigned to: @clechasseur on GitHub. Hi, maybe there is already some possiblity - unfortunately I wasn't able to find anything for the following request: Is it somehow possible to alter the default shown options in the context menu right at the installation process (regardless of the user, I will be installing the application for "all users"). I would be in need to alter the selectable shown Options not to default, advanced nor power-user layout but simply to just show only one entry without submenu, "Copy Long UNC Path" - with the extra Option "Add Quotes..." "...only if paths contain spaces". My initial thought was to use the Export/Import Settings feature but somehow I could not find any how to automate such an import when installing the application on another computer? Thank you in advance! /Dorian Seems to point in the directory of a request already posted- so I'll reference it here: hi there, cmd options would be great so that i could use this with deployment packs, yes the installer has them but it would be great to have some for in example importing a configuration while deploying the tool within network _Originally posted by @SnkrLifeAndStyle in https://github.com/clechasseur/pathcopycopy/issues/80#issuecomment-886632753_
kerem 2026-02-25 21:32:46 +03:00
Author
Owner

@clechasseur commented on GitHub (Jan 1, 2023):

There is a way, but it is highly undocumented currently. Basically, the installer supports command-line parameters to set default settings. Two of them will be of interest to you:

/PCCREGPIPELINEPLUGIN=<<plugin ID>>,<<plugin pipeline>>,<<description>>

This command-line argument will install a new custom command. If the installation is for all users, then all users will have access to the command. The command-line argument needs three things to install the command:

  • A plugin ID. This is a unique GUID value. When a custom command is created in the Settings application, such a unique ID is generated.
  • A pipeline, which is a string representation of the custom command's elements.
  • A description for the command in the menu.

All these informations can be found in the registry for a custom command. Example:

regedit_2DQDB0S7YK

After you copy all these informations, you can craft a command-line argument to install such a command:

/PCCREGPIPELINEPLUGIN="{0656d3db-895a-4427-a45b-518157852f9e},02{{ea24bcc3-35f5-46b9-a2a5-a12a0aed2d28}k,Long UNC Path (follow symlink)"

The second command-line argument that you will need to use is:

/PCCREGVALUESZ=<<value name>>,<<string value>>

This can be used to save a string registry value in the main Path Copy Copy registry key. In this case, you'll want to override the MainMenuDisplayOrder value. This value contains a comma-separated list of commands to display in the main contextual menu. In your case, you'll want it to contain a single ID, which is the ID of the custom command installed earlier. In our example:

/PCCREGVALUESZ=MainMenuDisplayOrder,{0656d3db-895a-4427-a45b-518157852f9e}

By using the two command-line arguments above when invoking the installer on a computer, you should be able to properly configure Path Copy Copy as you want it.

<!-- gh-comment-id:1368341498 --> @clechasseur commented on GitHub (Jan 1, 2023): There is a way, but it is highly undocumented currently. Basically, the installer supports command-line parameters to set default settings. Two of them will be of interest to you: `/PCCREGPIPELINEPLUGIN=<<plugin ID>>,<<plugin pipeline>>,<<description>>` This command-line argument will install a new custom command. If the installation is for all users, then all users will have access to the command. The command-line argument needs three things to install the command: - A plugin ID. This is a unique GUID value. When a custom command is created in the Settings application, such a unique ID is generated. - A pipeline, which is a string representation of the custom command's elements. - A description for the command in the menu. All these informations can be found in the registry for a custom command. Example: ![regedit_2DQDB0S7YK](https://user-images.githubusercontent.com/1435551/210160299-8939975c-bbed-4908-9ec8-083afcccef0c.png) After you copy all these informations, you can craft a command-line argument to install such a command: `/PCCREGPIPELINEPLUGIN="{0656d3db-895a-4427-a45b-518157852f9e},02{{ea24bcc3-35f5-46b9-a2a5-a12a0aed2d28}k,Long UNC Path (follow symlink)"` The second command-line argument that you will need to use is: `/PCCREGVALUESZ=<<value name>>,<<string value>>` This can be used to save a string registry value in the main Path Copy Copy registry key. In this case, you'll want to override the `MainMenuDisplayOrder` value. This value contains a comma-separated list of commands to display in the main contextual menu. In your case, you'll want it to contain a single ID, which is the ID of the custom command installed earlier. In our example: `/PCCREGVALUESZ=MainMenuDisplayOrder,{0656d3db-895a-4427-a45b-518157852f9e}` By using the two command-line arguments above when invoking the installer on a computer, you should be able to properly configure Path Copy Copy as you want it.
Author
Owner

@Dysterkind commented on GitHub (Jan 2, 2023):

Astonishing!

This was what I was looking for!

Just a short question for my understanding - why are we generating a custom command instead of "just" activating the "on-board" one?

I am currently using the technique with the custom command (which allows me to change the description for translate reasons) and setting options with PCCREGVALUESZ & PCCREGVALUEDWORD respectively.

Thank you!

/D

<!-- gh-comment-id:1368907268 --> @Dysterkind commented on GitHub (Jan 2, 2023): Astonishing! This was what I was looking for! Just a short question for my understanding - why are we generating a custom command instead of "just" activating the "on-board" one? I am currently using the technique with the custom command (which allows me to change the description for translate reasons) and setting options with PCCREGVALUESZ & PCCREGVALUEDWORD respectively. Thank you! /D
Author
Owner

@clechasseur commented on GitHub (Jan 2, 2023):

It's also possible to use a default command. It's just that I thought you wanted a custom one from your initial question.

Each default command also has an ID, but they cannot be found in the registry and are unfortunately mostly undocumented. They can be found in the code in a couple of places, perhaps more easily here:

https://github.com/clechasseur/pathcopycopy/blob/default/PathCopyCopySettings/Properties/Resources.resx

From this file, for example, we see that the Long UNC Path command ID is {EA24BCC3-35F5-46b9-A2A5-A12A0AED2D28} (as seen here).

<!-- gh-comment-id:1369178467 --> @clechasseur commented on GitHub (Jan 2, 2023): It's also possible to use a default command. It's just that I thought you wanted a custom one from your initial question. Each default command also has an ID, but they cannot be found in the registry and are unfortunately mostly undocumented. They can be found in the code in a couple of places, perhaps more easily here: https://github.com/clechasseur/pathcopycopy/blob/default/PathCopyCopySettings/Properties/Resources.resx From this file, for example, we see that the Long UNC Path command ID is `{EA24BCC3-35F5-46b9-A2A5-A12A0AED2D28}` (as seen [here](https://github.com/clechasseur/pathcopycopy/blob/default/PathCopyCopySettings/Properties/Resources.resx#L172)).
Author
Owner

@Dysterkind commented on GitHub (Jan 3, 2023):

Ah, I see, an assumption turning out quite handy, for translation reasons :)

Thank you for the ID, so I can use both flavors where applicable.

Thank you for your quick response and the very detailed information!

/D

<!-- gh-comment-id:1369477861 --> @Dysterkind commented on GitHub (Jan 3, 2023): Ah, I see, an assumption turning out quite handy, for translation reasons :) Thank you for the ID, so I can use both flavors where applicable. Thank you for your quick response and the very detailed information! /D
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/pathcopycopy#158
No description provided.