Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > alt.comp.microsoft.windows > #2939 > unrolled thread

Tutorial: Add "Copy path to clipboard" into the rightclick file explorer context menu when saving files

Started byMarion <mariond@facts.com>
First post2025-10-27 00:21 -0600
Last post2025-10-29 11:48 -0600
Articles 14 — 5 participants

Back to article view | Back to alt.comp.microsoft.windows


Contents

  Tutorial: Add "Copy path to clipboard" into the rightclick file explorer context menu when saving files Marion <mariond@facts.com> - 2025-10-27 00:21 -0600
    Re: Tutorial: Add "Copy path to clipboard" into the rightclick file explorer context menu when saving files "R.Wieser" <address@is.invalid> - 2025-10-27 11:13 +0100
      Re: Tutorial: Add "Copy path to clipboard" into the rightclick file explorer context menu when saving files Marion <mariond@facts.com> - 2025-10-27 13:14 -0600
        Re: Tutorial: Add "Copy path to clipboard" into the rightclick file explorer context menu when saving files "R.Wieser" <address@is.invalid> - 2025-10-27 23:07 +0100
          Re: Tutorial: Add "Copy path to clipboard" into the rightclick file explorer context menu when saving files Marion <mariond@facts.com> - 2025-10-27 19:34 -0600
    Re: Tutorial: Add "Copy path to clipboard" into the rightclick file explorer context menu when saving files MikeS <mikes@is.invalid> - 2025-10-27 13:30 +0000
      Re: Tutorial: Add "Copy path to clipboard" into the rightclick file explorer context menu when saving files Marion <mariond@facts.com> - 2025-10-27 12:58 -0600
        Re: Tutorial: Add "Copy path to clipboard" into the rightclick file explorer context menu when saving files Andy Burns <usenet@andyburns.uk> - 2025-10-27 19:06 +0000
          Re: Tutorial: Add "Copy path to clipboard" into the rightclick file explorer context menu when saving files Marion <mariond@facts.com> - 2025-10-27 13:51 -0600
            Re: Tutorial: Add "Copy path to clipboard" into the rightclick file explorer context menu when saving files Herbert Kleebauer <klee@unibwm.de> - 2025-10-27 22:11 +0100
              Re: Tutorial: Add "Copy path to clipboard" into the rightclick file explorer context menu when saving files Marion <mariond@facts.com> - 2025-10-27 18:56 -0600
            Re: Tutorial: Add "Copy path to clipboard" into the rightclick file explorer context menu when saving files Andy Burns <usenet@andyburns.uk> - 2025-10-27 22:05 +0000
              Re: Tutorial: Add "Copy path to clipboard" into the rightclick file explorer context menu when saving files Marion <mariond@facts.com> - 2025-10-27 19:12 -0600
    Re: Tutorial: Add "Copy path to clipboard" into the rightclick file explorer context menu when saving files Marion <mariond@facts.com> - 2025-10-29 11:48 -0600

#2939 — Tutorial: Add "Copy path to clipboard" into the rightclick file explorer context menu when saving files

FromMarion <mariond@facts.com>
Date2025-10-27 00:21 -0600
SubjectTutorial: Add "Copy path to clipboard" into the rightclick file explorer context menu when saving files
Message-ID<10dn31k$2ltj$1@nnrp.usenet.blueworldhosting.com>
Efficiency: 
 If something takes x number of steps to do, we reduce it to one step.

Tutorial: 
Add "Copy path to clipboard" into the rightclick file explorer context menu
when saving files (e.g., when saving files in Irfanview's browser).

I never use search on Windows because I have well-organized file
hierarchies, but deep hierarchies can cause a multi-click inefficiency
when, for example, I'm in Irfanview & I save an image somewhere.
 Irfanview:File > Save as... (then I have to browse somewhere)

What I want, in that "Save as..." GUI, is the ability to do 3 things:
 1. Open up a separate file explorer window there (to edit the file)
 2. Or, open a command window there (to work on the file)
 3. Or, copy the path to the clipboard (to use in other programs)

To help with that, I previously wrote a tutorial to add these two lines
to the Windows rightclick context menu when saving files... 
  Rightclick > Open File Explorer Here
  Rightclick > Open Command Windows Here
Where this tutorial adds a 3rd command to save the path to the clipboard:
  Rightclick > Copy Path to Clipboard

Here are the manual steps (registry file is below):
1. In the registry, create a new subkey called "CopyPath" in the shell key:
   HKEY_CLASSES_ROOT\Directory\Background\shell

2. Set its display name to "Copy Path to Clipboard" (or whatever you like):
   Computer\HKEY_CLASSES_ROOT\Directory\Background\shell\CopyPath

3. In the CopyPath key, double-click the (Default) value and set it to:
   Copy Path to Clipboard

4. Right-click on CopyPath, choose New > Key, and name it "command":
   Computer\HKEY_CLASSES_ROOT\Directory\Background\shell\CopyPath\command

5. In the command key, double-click the (Default) value and set it to:
   cmd.exe /c echo "%V" | clip

Now, when we right-click in the white space of a folder or in a modern file
dialog (like IrfanView's save window), we will see "Copy Path to Clipboard"
alongside our other custom entries. Clicking it will instantly copy the
current folder path to our clipboard. The goal is saving steps.

Since there's a "Win+R" runbox pinned to my taskbar, I can subsequently
open up that folder any time later by pasting the clipboard into it.

In case there are spaces in the path, the clipboard entry is surrounded by
doublequotes, so it should work instantly when you click this *.reg file.

 Windows Registry Editor Version 5.00

 ; --- Open File Explorer Here ---
 [HKEY_CLASSES_ROOT\Directory\Background\shell\OpenExplorerHere]
 @="Open File Explorer Here"
 "Icon"="imageres.dll,-5302"

If needed, here's a reg file that adds all three efficiency tweaks:
 a. Open Command Window Here
 b. Open File Explorer Here
 c. Copy Path to Clipboard

  Windows Registry Editor Version 5.00
  
  ; --- Open File Explorer Here ---
  [HKEY_CLASSES_ROOT\Directory\Background\shell\OpenExplorerHere]
  @="Open File Explorer Here"
  "Icon"="imageres.dll,-5302"
  [HKEY_CLASSES_ROOT\Directory\Background\shell\OpenExplorerHere\command]
  @="explorer.exe %V"
  
  ; --- Open Command Window Here ---
  [HKEY_CLASSES_ROOT\Directory\Background\shell\OpenCmdHere]
  @="Open CLI Window Here"
  "Icon"="imageres.dll,-5324"
  [HKEY_CLASSES_ROOT\Directory\Background\shell\OpenCmdHere\command]
  @="cmd.exe /k cd /d %V"
  
  ; --- Copy Path to Clipboard ---
  [HKEY_CLASSES_ROOT\Directory\Background\shell\CopyPath]
  @="Copy Path to Clipboard"
  "Icon"="imageres.dll,-5302"
  [HKEY_CLASSES_ROOT\Directory\Background\shell\CopyPath\command]
  @="cmd.exe /c echo \"%V\" | clip"

Note the Windows quirk that the order we wrote them in the .reg file does
not strictly guarantee the order in the right-click menu. Windows Explorer
usually sorts shell context menu entries alphabetically by key name.

So in practice, we will likely see them in this order:
 c. Copy Path to Clipboard 
 a. Open Command Window Here 
 b. Open File Explorer Here 

If we want to force a specific order, we can prefix the key names with
numbers or letters, if that's an issue, such as these examples below.
 [HKEY_CLASSES_ROOT\Directory\Background\shell\01OpenExplorerHere]
 [HKEY_CLASSES_ROOT\Directory\Background\shell\02OpenCmdHere]
 [HKEY_CLASSES_ROOT\Directory\Background\shell\03CopyPath]

I also added an "Open Admin Window Here" but that's more involved.
-- 
I tweak windows so ten steps become five, and five become one if I can.
This is voluntarily posted to help others, where I'm altruistic that way.

[toc] | [next] | [standalone]


#2940

From"R.Wieser" <address@is.invalid>
Date2025-10-27 11:13 +0100
Message-ID<10dngoj$ndvk$1@dont-email.me>
In reply to#2939
Arlen,

> If something takes x number of steps to do, we reduce it to one step.
...
>  ; --- Open File Explorer Here ---
...
>  ; --- Open Command Window Here ---
...
>  ; --- Copy Path to Clipboard ---

All of those need two clicks : click to open the context menu, click to 
select the option.


The first one already exist, in two forms : "explore" and "open".  Also, 
select and pressing "enter" will be enough to explore that folder.  Saves 
you another step.

The second one I'm using myself too.

The third one ?  You can right-click the string in the "address" bar and 
select copy.  It would take you the same ammount of clicks.

In the worst case you would remove /one/ click from the multi-click process 
(open file-browser, click the drive, click thru the folder tree to select 
the one you want).

But congrats, you found another way to do something. Well done. Seriously.

Regards,
Rudy Wieser

[toc] | [prev] | [next] | [standalone]


#2944

FromMarion <mariond@facts.com>
Date2025-10-27 13:14 -0600
Message-ID<10dogav$27il$1@nnrp.usenet.blueworldhosting.com>
In reply to#2940
R.Wieser wrote:
> All of those need two clicks : click to open the context menu, click to 
> select the option.

OK. Fair enough. If you know Windows well enough to reduce it to one click,
I'll be the first person to test out your tutorial helpfully posted by you.

> The first one already exist, in two forms : "explore" and "open".  Also, 
> select and pressing "enter" will be enough to explore that folder.  Saves 
> you another step.

Hmmm... maybe you know Irfanview's file browser better than I do, Rudy, 
so allow me to explain the specific situation outlined in the OP.

I ask you (and others) to run this simple experiment with Irfanview.
1. Open an image in Irfanview & use the "Save as" dialog to save it.
    Irfanview:File > Save as.. 
2. I created a long hierarchy for the testcase but use any path you like.
   C:\tmp\tmp2\tmp3\...\tmp10\image.jpg
3. After you are done navigating, but just before you save the image,
   where does "explore" or "open" exist in that subsequent file browser?
   <https://i.postimg.cc/QxB1MwgM/Irfanview-File-Browse-GUI.jpg>

> The second one I'm using myself too.

I had to go back to the OP to see what you meant by "the second one".
It seems to be the "Open command window here" which I too already had.

If you look at the screenshot below, you'll see I already had it also:
 <https://i.postimg.cc/QxB1MwgM/Irfanview-File-Browse-GUI.jpg>

The advantage of my method is simply that all 3 are together
in the same shell key, as that "open command window here" rightclick
context-menu came from elsewhere in the Windows system registry:
 Irfanview:File > Save as...  C:\tmp\tmp2\tmp3\...\tmp10\image.jpg
   Rightclick: (1) [Copy Path to Clipboard]
               (2) [Open CLI Window Here]
               (3) [Open File Explorer Here]

 All being in the same location in the same "shell" registry key:
  1. HKEY_CLASSES_ROOT\Directory\Background\shell\CopyPath
  2. HKEY_CLASSES_ROOT\Directory\Background\shell\OpenCmdHere
  3. HKEY_CLASSES_ROOT\Directory\Background\shell\OpenExplorerHere

> The third one ?  You can right-click the string in the "address" bar and 
> select copy.  It would take you the same ammount of clicks.

Maybe you know Windows better than I do, so I ask you simply to try to
reproduce that action since if you can, it would negate the need.

Please start a modern app such as Irfanview is, then click the "Save as" to
transcend down a deep hierarchy & just before you save the file, please try
to do what you just suggested to let me know how well it works out for you.

If you can do what you said you can, then you know Windows better than I.

> In the worst case you would remove /one/ click from the multi-click process 
> (open file-browser, click the drive, click thru the folder tree to select 
> the one you want).
> 
> But congrats, you found another way to do something. Well done. Seriously.

The advantage of the three methods doesn't mean there aren't other ways to
do it, but if you can do what you say, please try it first & respond back.

If you truly can get the full path, open the command line, and copy the
full path to the clipboard when you File > Save As" in Irfanview, just
moments before saving the file, then that means you can teach it to me.

And if you teach it to me, then everyone benefits from your knowledge.

Try it first though please. Then let us know how it works out for you.
 <https://i.postimg.cc/QxB1MwgM/Irfanview-File-Browse-GUI.jpg>

[toc] | [prev] | [next] | [standalone]


#2948

From"R.Wieser" <address@is.invalid>
Date2025-10-27 23:07 +0100
Message-ID<10doqgc$18knq$1@dont-email.me>
In reply to#2944
Arlen,

>> All of those need two clicks : click to open the context menu, click to
>> select the option.
>
> OK. Fair enough. If you know Windows well enough to reduce it to one 
> click,
> I'll be the first person to test out your tutorial helpfully posted by 
> you.

Sigh.  Think about it kiddo, thats impossible.

... unless you always have the relevant context-menu open on your screen. 
And than you have the problem /which/ context menu is relevant.  All of them 
perhaps ?

Iow, there is a *reason* you have to right-click for a context menu. 
Besides that some are dynamic ofcourse.

You consider yourself smart.  In that case, *use* those gray cells of yours.

> Hmmm... maybe you know Irfanview's file browser better than I do, Rudy,

Nope, I don't.  I do not even use it.   The problem is that you, as so 
often, are throwing unrelated stuff together and than expect us to make 
sense of it.

The "file explorer" is one thing, the "save file as" dialog a *completely 
different* one.  My reply was for what you mentioned in your subject line 
(as well as in the post itself), the file explorer.

>> The second one I'm using myself too.
>
> I had to go back to the OP to see what you meant by "the second
> one". It seems to be the "Open command window here" which I too
> already had.

Yes, that is what I tried to tell you : Years ago I, Just like you, figured 
out how to add such an option.

> Please start a modern app such as Irfanview is

Irfanview is from 1996, an as such /ancient/.

> The advantage of my method is simply that all 3 are together
> in the same shell key,

As I already mentioned, I have the other two too, provided by my OS.  Do I 
think I need to shave off a single click somewhere ?  Not at all, thats 
wholly your thing.

> then click the "Save as" to transcend down a deep hierarchy
> & just before you save the file,

Kiddo, not everyone needs to be told the same thing over-and-over again.  I 
already understood you the first time you said that.

And in that same direction, why did you post the link to the same image four 
times in your post ?  Are you stil thinking that all of us are stupid, and 
only repetition will get us to learn anything ?

> The advantage of the three methods doesn't mean there aren't
> other ways to do it,

No.  For two of them you have simply duplicated what the OS already offers 
us with the file explorer.

> but if you can do what you say, please try it first & respond back.

Sir, soldier Wieser is reporting back : I've been using similar, OS provided 
ways for options one and three for years now, and had number two put 
together and have been using it for years now too. Sir.  For the file 
explorer. Sir.

> If you truly can get the full path, open the command line,
> and copy the full path to the clipboard when you File > Save
> As" *in Irfanview*,

(bolding mine)

And there you have your problem : you ask about one thing, but than 
somewhere start to talk about something different.

> And if you teach it to me, then everyone benefits from your knowledge.

:-)  Yeah, no.  The "trickle down" theory is a farce.  Also, We've tried 
that before and it doesn't work for either of us.

Also, there is stil *way* to much that you can google for yourself.  I'm not 
your fetching dog I'm afraid.  None of us is.

Regards,
Rudy Wieser

[toc] | [prev] | [next] | [standalone]


#2951

FromMarion <mariond@facts.com>
Date2025-10-27 19:34 -0600
Message-ID<10dp6jc$2sii$1@nnrp.usenet.blueworldhosting.com>
In reply to#2948
R.Wieser wrote:
> Irfanview is from 1996, an as such /ancient/.

I think, with your help and that of others, I figured out (and solved) it.
 <https://i.postimg.cc/wjdDcbqL/windows10copyaspath.jpg>

This registry change makes Win10 show 'Copy as path' everywhere, just like
Win11 does out of the box (which was unbeknownst to me until now).

 Windows Registry Editor Version 5.00

 ; --- Always show "Copy as path" on right-click ---
 [HKEY_CLASSES_ROOT\AllFilesystemObjects\shell\windows.copyaspath]
 "NeverDefault"=-

I just added that registry entry to make Windows 10 act like Windows 11 in
terms of the "copy as path" (which I hadn't known was different until now).

The is the before-and-after when rightclicking on a folder in Irfanview:
  <https://i.postimg.cc/wjdDcbqL/windows10copyaspath.jpg>
 
The difference isn't IrfanView or Notepad, it's the Windows version!

Unbeknownst to me until everyone said it was there even though it wasn't
there, I didn't realize that Windows 11 exposes 'Copy as path' everywhere
by default while Windows 10 hides it unless you hold Shift. 

Luckily, this registry tweak above closes that gap, giving all of us the
same always-visible command across File Explorer and file dialogs.

Thanks for explaining that Win11 is completely different than Win10 in this
respect, where now all of us can benefit from these latest registry tweaks.
-- 
The goal always is to help others and to learn in the process of doing so.

[toc] | [prev] | [next] | [standalone]


#2941

FromMikeS <mikes@is.invalid>
Date2025-10-27 13:30 +0000
Message-ID<10dns58$1minp$1@solani.org>
In reply to#2939
On 27/10/2025 06:21, Marion wrote:
> Efficiency:
>   If something takes x number of steps to do, we reduce it to one step.
> 
> Tutorial:
> Add "Copy path to clipboard" into the rightclick file explorer context menu
> when saving files (e.g., when saving files in Irfanview's browser).
> 
> I never use search on Windows because I have well-organized file
> hierarchies, but deep hierarchies can cause a multi-click inefficiency
> when, for example, I'm in Irfanview & I save an image somewhere.
>   Irfanview:File > Save as... (then I have to browse somewhere)
> 
> What I want, in that "Save as..." GUI, is the ability to do 3 things:
>   1. Open up a separate file explorer window there (to edit the file)
>   2. Or, open a command window there (to work on the file)
>   3. Or, copy the path to the clipboard (to use in other programs)
> 
> To help with that, I previously wrote a tutorial to add these two lines
> to the Windows rightclick context menu when saving files...
>    Rightclick > Open File Explorer Here
>    Rightclick > Open Command Windows Here
> Where this tutorial adds a 3rd command to save the path to the clipboard:
>    Rightclick > Copy Path to Clipboard
> 
> Here are the manual steps (registry file is below):
> 1. In the registry, create a new subkey called "CopyPath" in the shell key:
>     HKEY_CLASSES_ROOT\Directory\Background\shell
> 
> 2. Set its display name to "Copy Path to Clipboard" (or whatever you like):
>     Computer\HKEY_CLASSES_ROOT\Directory\Background\shell\CopyPath
> 
> 3. In the CopyPath key, double-click the (Default) value and set it to:
>     Copy Path to Clipboard
> 
> 4. Right-click on CopyPath, choose New > Key, and name it "command":
>     Computer\HKEY_CLASSES_ROOT\Directory\Background\shell\CopyPath\command
> 
> 5. In the command key, double-click the (Default) value and set it to:
>     cmd.exe /c echo "%V" | clip
> 
> Now, when we right-click in the white space of a folder or in a modern file
> dialog (like IrfanView's save window), we will see "Copy Path to Clipboard"
> alongside our other custom entries. Clicking it will instantly copy the
> current folder path to our clipboard. The goal is saving steps.
> 
> Since there's a "Win+R" runbox pinned to my taskbar, I can subsequently
> open up that folder any time later by pasting the clipboard into it.
> 
> In case there are spaces in the path, the clipboard entry is surrounded by
> doublequotes, so it should work instantly when you click this *.reg file.
> 
>   Windows Registry Editor Version 5.00
> 
>   ; --- Open File Explorer Here ---
>   [HKEY_CLASSES_ROOT\Directory\Background\shell\OpenExplorerHere]
>   @="Open File Explorer Here"
>   "Icon"="imageres.dll,-5302"
> 
> If needed, here's a reg file that adds all three efficiency tweaks:
>   a. Open Command Window Here
>   b. Open File Explorer Here
>   c. Copy Path to Clipboard
> 
>    Windows Registry Editor Version 5.00
>    
>    ; --- Open File Explorer Here ---
>    [HKEY_CLASSES_ROOT\Directory\Background\shell\OpenExplorerHere]
>    @="Open File Explorer Here"
>    "Icon"="imageres.dll,-5302"
>    [HKEY_CLASSES_ROOT\Directory\Background\shell\OpenExplorerHere\command]
>    @="explorer.exe %V"
>    
>    ; --- Open Command Window Here ---
>    [HKEY_CLASSES_ROOT\Directory\Background\shell\OpenCmdHere]
>    @="Open CLI Window Here"
>    "Icon"="imageres.dll,-5324"
>    [HKEY_CLASSES_ROOT\Directory\Background\shell\OpenCmdHere\command]
>    @="cmd.exe /k cd /d %V"
>    
>    ; --- Copy Path to Clipboard ---
>    [HKEY_CLASSES_ROOT\Directory\Background\shell\CopyPath]
>    @="Copy Path to Clipboard"
>    "Icon"="imageres.dll,-5302"
>    [HKEY_CLASSES_ROOT\Directory\Background\shell\CopyPath\command]
>    @="cmd.exe /c echo \"%V\" | clip"
> 
> Note the Windows quirk that the order we wrote them in the .reg file does
> not strictly guarantee the order in the right-click menu. Windows Explorer
> usually sorts shell context menu entries alphabetically by key name.
> 
> So in practice, we will likely see them in this order:
>   c. Copy Path to Clipboard
>   a. Open Command Window Here
>   b. Open File Explorer Here
> 
> If we want to force a specific order, we can prefix the key names with
> numbers or letters, if that's an issue, such as these examples below.
>   [HKEY_CLASSES_ROOT\Directory\Background\shell\01OpenExplorerHere]
>   [HKEY_CLASSES_ROOT\Directory\Background\shell\02OpenCmdHere]
>   [HKEY_CLASSES_ROOT\Directory\Background\shell\03CopyPath]
> 
> I also added an "Open Admin Window Here" but that's more involved.

"Copy as path" already exists in my right click file explorer context 
menu. Where do you think it goes if not the clipboard?

Congratulations on reaching new heights in your efforts to make simple 
tasks difficult.

[toc] | [prev] | [next] | [standalone]


#2942

FromMarion <mariond@facts.com>
Date2025-10-27 12:58 -0600
Message-ID<10dofcu$22ak$1@nnrp.usenet.blueworldhosting.com>
In reply to#2941
MikeS wrote:
> "Copy as path" already exists in my right click file explorer context 
> menu. Where do you think it goes if not the clipboard?

I welcome your input as maybe I don't know Windows as well as you do.
 <https://i.postimg.cc/QxB1MwgM/Irfanview-File-Browse-GUI.jpg>

Maybe you can teach me how you do it, since I needed to write those three
registry hacks in order to gain the efficiency in modern file saveas guis.

Is "copy as path" in everyone's right click context menu when they are in
the middle of saving a file from modern apps such as Irfanview is?

> Congratulations on reaching new heights in your efforts to make simple 
> tasks difficult.

Again, you seem to understand modern app file browsers better than I do.

Please take a look at that image I created to illustrate the question
you asked, since you seem to know how Windows works better than I do.
 <https://i.postimg.cc/QxB1MwgM/Irfanview-File-Browse-GUI.jpg>

I ask you (and others) to run this simple experiment with Irfanview.
1. Open an image in Irfanview & use the "Save as" dialog to save it.
    Irfanview:File > Save as.. 
2. I created a long hierarchy for the testcase but use any path you like.
   C:\tmp\tmp2\tmp3\...\tmp10\image.jpg
3. Where does "copy as path" exist in that subsequent file browser?
   <https://i.postimg.cc/QxB1MwgM/Irfanview-File-Browse-GUI.jpg>

Without adding "copy as path" into the registry, how would we be able to
copy the path of the final destination in that modern app filebrowser GUI?

Please let me know how you do the 3 things explained in this thread at the
point a moment before you save the image into that often deep hierarchy.
 Irfanview:File > Save as...  C:\tmp\tmp2\tmp3\...\tmp10\image.jpg
   Rightclick: [Copy Path to Clipboard]
               [Open CLI Window Here]
               [Open File Explorer Here]
As shown in this annotated screenshot I just made to illustrate the issue:
 <https://i.postimg.cc/QxB1MwgM/Irfanview-File-Browse-GUI.jpg>

[toc] | [prev] | [next] | [standalone]


#2943

FromAndy Burns <usenet@andyburns.uk>
Date2025-10-27 19:06 +0000
Message-ID<mm9u5uFa7f0U1@mid.individual.net>
In reply to#2942
Marion wrote:

> Is "copy as path" in everyone's right click context menu when they are in
> the middle of saving a file

Yes.  I too was surprised to see you suggesting 'adding' a feature that 
already existed

[toc] | [prev] | [next] | [standalone]


#2945

FromMarion <mariond@facts.com>
Date2025-10-27 13:51 -0600
Message-ID<10doiga$2gqv$1@nnrp.usenet.blueworldhosting.com>
In reply to#2943
Andy Burns wrote:
>> Is "copy as path" in everyone's right click context menu when they are in
>> the middle of saving a file
> 
> Yes.  I too was surprised to see you suggesting 'adding' a feature that 
> already existed

Hi Andy,

I didn't take the other two posters seriously as they're always trying to
prove their supposed superiority, which this isn't a contest of nor for.

They never add. 
They subtract.
So my response to them is completely different than my response to you.

This is about additive learning. 
And additive capability.

I respect you.
I respect your knowledge.
You've taught me a lot over the years.
And, almost always, you've been right when you've done that.

So, maybe there's something that I don't know. 
Which I welcome if you can teach it to me.

I believe you that what you claim exists, but I think we may not both be
talking about the same GUI since there are three Windows GUIs involved.

For lack of a better name, I'll refer to the three different GUIs as... 
1. Old App GUI, aka the Common Dialog Box (Win32)
2. Normal GUI, aka the Explorer-style Common Item Dialog
3. Modern App GUI, aka the FileOpenPicker/FileSavePicker/FolderPicker

Modern apps like IrfanView often use the FileOpenPicker, FileSavePicker, or
FolderPicker classes from the Windows.Storage.Pickers namespace. These
pickers are designed to be lightweight, secure and sandbox-friendly,
especially for apps running with limited permissions.
 <https://github.com/microsoft/WindowsAppSDK/issues/1188>

That design choice limits certain features like copying the full file path
(to maintain consistency and security across devices and app types).
 <https://learn.microsoft.com/en-us/windows/uwp/files/quickstart-using-file-and-folder-pickers>

Please look closely at this screenshot which shows where I'm looking.
 <https://i.postimg.cc/QxB1MwgM/Irfanview-File-Browse-GUI.jpg>
That is using the Windows Runtime / WinRT API used by modern apps which
was introduced in Windows 8, but it doesn't have a full-path copy (AFAIK).

That screenshot was taken moments before saving the file using any modern
app such as Irfanview is, so it may be very important to note that the
browsing GUI is NOT the same as in the File Explorer browsing GUI.

Before Windows 8, the "old GUI" used the Win32 GetOpenFileName or
GetSaveFileName which was introduced way back in the Windows 3.x era.

But modern apps such as Irfanview use the newer FileOpenPicker or
FileSavePicker found in the Windows Runtime / WinRT API. 

This is DIFFERENT from the Explorer-style Common Item Dialog which uses
IFileDialog calls (specifically IFileOpenDialog & IFileSaveDialog).

So maybe we're talking about two different GUIs?

These other two browsing GUIs are completely different in how the context
menu works (ask me how I know that) in that not all registry hacks work.

Of course, there is overlap in the two file browsing GUIs, but the ability
to save the path does not seem to be included in that browser GUI overlap.

There's a lot more overlap in the rightclick context menu, but even that
overlap isn't 100% as you can see they're not the same in this shot below.
 <https://i.postimg.cc/tJVBjT2D/Two-File-Browser-Right-Click-Menus.jpg>

Since you DO know Windows better than I do, I wonder if the disconnect is
you're thinking I'm using the Windows native File Browser GUI?

I'm not (although these registry tweaks certainly work for the native
Windows File Browser GUI also, but it's easy to get the path there).

I'm talking about the 'special purpose' GUI (for lack of a better name)
that pops up only when you use a modern app's "File > Save as..." menus.

To clarify which GUI this tutorial pertains to, can you do all of us a
favor and run the same test I had suggested Rudy & MikeS run for us?
1. Open an image in Irfanview & use the "Save as" dialog to save it.
    Irfanview:File > Save as.. 
2. I created a long hierarchy for the testcase but use any path you like.
   C:\tmp\tmp2\tmp3\...\tmp10\image.jpg
3. After you are done navigating, but just before you save the image,
   where does what you say exists, exist in that subsequent file browser?
   <https://i.postimg.cc/QxB1MwgM/Irfanview-File-Browse-GUI.jpg>

Please let me know as maybe I'm doing something wrong and maybe these
registry tweaks didn't need to be made to add the functionality added.
-- 
I am not here for my ego; nor for my amusement; but to teach & learn.

[toc] | [prev] | [next] | [standalone]


#2946

FromHerbert Kleebauer <klee@unibwm.de>
Date2025-10-27 22:11 +0100
Message-ID<10don60$16rh9$1@dont-email.me>
In reply to#2945
On 10/27/2025 8:51 PM, Marion wrote:

> To clarify which GUI this tutorial pertains to, can you do all of us a
> favor and run the same test I had suggested Rudy & MikeS run for us?
> 1. Open an image in Irfanview & use the "Save as" dialog to save it.
>      Irfanview:File > Save as..
> 2. I created a long hierarchy for the testcase but use any path you like.
>     C:\tmp\tmp2\tmp3\...\tmp10\image.jpg
> 3. After you are done navigating, but just before you save the image,
>     where does what you say exists, exist in that subsequent file browser?
>     <https://i.postimg.cc/QxB1MwgM/Irfanview-File-Browse-GUI.jpg>


|| Now, when we right-click in the white space of a folder or in a modern file
|| dialog (like IrfanView's save window), we will see "Copy Path to Clipboard"
|| alongside our other custom entries. Clicking it will instantly copy the
|| current folder path to our clipboard. The goal is saving steps.

Don't right-click in the white space but on a folder. When you are in
.....\temp9 right-click on temp10 before you enter temp10.

[toc] | [prev] | [next] | [standalone]


#2949

FromMarion <mariond@facts.com>
Date2025-10-27 18:56 -0600
Message-ID<10dp4b1$4mq$1@nnrp.usenet.blueworldhosting.com>
In reply to#2946
Herbert Kleebauer wrote:
> Don't right-click in the white space but on a folder. When you are in
> .....\temp9 right-click on temp10 before you enter temp10.

Hi Herbert,

This helps a lot. Thanks. It turns out that the common file dialog (used by
IrfanView and many other apps) doesn't always load the same handlers as the
native Windows File Explorer does, so custom entries often need explicit
registry tweaks to appear there (which is why I think the tutorial needed).

You've helped me a lot over the years, where I'm still using your Balabolka
TTS spell speaker that teaches the spelling of all the redsquiggled words.

I also use your timezone randomizer and the script that hides the console
when I use adb to bring up a scrcopy window of Android on Windows.

Hence I much appreciate that you always strive to add value to the ng.

To your point, I had not ever thought about rightclicking on a folder,
which, when I just did it now, brings up yet another DIFFERENT menu than
when clicking in white space in the modern app's "File > Save as..." GUI.
 <https://i.postimg.cc/rmjz2QxH/rightclick-on-folder.jpg>

Note all three menus are different (e.g., the rightclick on a folder inside
the "Irfanview:File > Save as..." has an "Open Admin Command Window Here".

What's the same as that Irfanview folder rightclick is if I rightclick on
any folder in the File Explorer (which I could tell because my custom 
"Open Admin Command Windows Here" was installed long ago for that purpose).

This makes sense when we dig down a bit to think about why this is so.

Windows context menus are generated by the shell based on the type of
object you right-click (background vs. folder vs. file), the host
environment (Explorer vs. common file dialog), and the registered shell
extensions that hook into those objects.

1. Right-click on the Windows 10 desktop or File Explorer white space
a. This invokes the background context menu for the current folder.
b. It's controlled by registry keys like:    
   HKEY_CLASSES_ROOT\Directory\Background\shell
c. Items here include things like View, Sort by, New, 
   and any shell extensions registered for folder backgrounds.

2. Right-click in the white space of IrfanView's "Save As" dialog
a. This isn't File Explorer proper as it's a common file dialog 
   (which is a Windows system control hosted inside IrfanView).
b. The dialog uses a different shell view implementation with 
   its own pared-down context menu.
   HKEY_CLASSES_ROOT\Directory\Background\shell
c. Many third-party shell extensions don't load here for stability
   and security reasons, so the menu looks different.

3. Right-click on a folder (in Explorer or in the Save As dialog)
a. This invokes the folder object's context menu.
b. The dialog is controlled by registry keys like:
   HKEY_CLASSES_ROOT\Directory\shell and     
   HKEY_CLASSES_ROOT\Directory\shellex\ContextMenuHandlers
c. Items here include Open, Open in new window, Pin to Quick Access,
   plus third-party handlers (e.g., compression tools, version control).

However, all that having been said, I think the tutorial still adds immense
value since with it we can do all 3 things which we can't do without it.
   Rightclick: [Copy Path to Clipboard]
               [Open CLI Window Here]
               [Open File Explorer Here]

All of which were created by the following registry files:
 Windows Registry Editor Version 5.00

 ; --- Open File Explorer Here ---
 [HKEY_CLASSES_ROOT\Directory\Background\shell\OpenExplorerHere]
 @="Open File Explorer Here"
 "Icon"="imageres.dll,-5302"

If needed, here's a reg file that adds all three efficiency tweaks:
 a. Open Command Window Here
 b. Open File Explorer Here
 c. Copy Path to Clipboard

  Windows Registry Editor Version 5.00
  
  ; --- Open File Explorer Here ---
  [HKEY_CLASSES_ROOT\Directory\Background\shell\OpenExplorerHere]
  @="Open File Explorer Here"
  "Icon"="imageres.dll,-5302"
  [HKEY_CLASSES_ROOT\Directory\Background\shell\OpenExplorerHere\command]
  @="explorer.exe %V"
  
  ; --- Open Command Window Here ---
  [HKEY_CLASSES_ROOT\Directory\Background\shell\OpenCmdHere]
  @="Open CLI Window Here"
  "Icon"="imageres.dll,-5324"
  [HKEY_CLASSES_ROOT\Directory\Background\shell\OpenCmdHere\command]
  @="cmd.exe /k cd /d %V"
  
  ; --- Copy Path to Clipboard ---
  [HKEY_CLASSES_ROOT\Directory\Background\shell\CopyPath]
  @="Copy Path to Clipboard"
  "Icon"="imageres.dll,-5302"
  [HKEY_CLASSES_ROOT\Directory\Background\shell\CopyPath\command]
  @="cmd.exe /c echo \"%V\" | clip"

These entries appear consistently in Explorer and in common file dialogs
(like IrfanView's Save As), because both environments query the same
Directory\Background\shell keys.

This tutorial effectively unified the menus across contexts, which solves
the inconsistency problems all noticed between the methods. The beauty is
that these commands are lightweight, don't require extra software, and
leverage built-in Windows tools.

Note that on Windows 11, context menu handling changed (with the 'Show more
options' layer), so these entries still work but may be tucked under the
legacy menu.

[toc] | [prev] | [next] | [standalone]


#2947

FromAndy Burns <usenet@andyburns.uk>
Date2025-10-27 22:05 +0000
Message-ID<mma8m6FbtepU1@mid.individual.net>
In reply to#2945
Marion wrote:

> Modern apps like IrfanView often use the FileOpenPicker, FileSavePicker, or
> FolderPicker classes from the Windows.Storage.Pickers namespace. These
> pickers are designed to be lightweight, secure and sandbox-friendly,
> especially for apps running with limited permissions.

I'm not sure I think of IrfanView as a modern app (certainly not modern 
looking, more like win2K era) but I must admit I haven't installed it 
for a few years.

> Please look closely at this screenshot which shows where I'm looking.
>   <https://i.postimg.cc/QxB1MwgM/Irfanview-File-Browse-GUI.jpg>

I used win11 Notepad, and did a file/saveas, navigated into a nested 
folder, just right-click on any folder while still in that saveas 
process and the context menu includes "copy as path" which places the 
full path (even for UNC shares) to the clipboard.


[toc] | [prev] | [next] | [standalone]


#2950

FromMarion <mariond@facts.com>
Date2025-10-27 19:12 -0600
Message-ID<10dp592$rgs$1@nnrp.usenet.blueworldhosting.com>
In reply to#2947
Andy Burns wrote:
> I'm not sure I think of IrfanView as a modern app (certainly not modern 
> looking, more like win2K era) but I must admit I haven't installed it 
> for a few years.

Hi Andy,

You bring up a good point that Irfanview is "old", but I just tested it
with Firefox & Notepad++ and the rightclick menus are EXACTLY the same.

What matters is the API used by the app, so while you're right that
IrfanView itself looks very "classic Win32", the important bit here isn't
the app's age or style. It's the API it calls when you hit File > Save As. 

IrfanView, Firefox, Notepad++, and most other "modern" programs all rely on
the same Windows-supplied Common File Dialog. That dialog is a system
component provided by the shell, not something the app builds itself.

Because of that, the right-click menus we see inside those dialogs are
generated by Windows in exactly the same way, regardless of whether the
host app looks like Windows 2000 or Windows 11. 

The consistency comes from the API contract. So if an app uses the common
dialog, we all get the same shell integration and context menus. However,
if an app rolls its own custom file picker (some UWP/"modern" apps do),
then we'll see different behavior.

So the real dividing line isn't "old vs. modern looking," it's which
Windows API the app uses to request a file dialog.

>> Please look closely at this screenshot which shows where I'm looking.
>>   <https://i.postimg.cc/QxB1MwgM/Irfanview-File-Browse-GUI.jpg>
> 
> I used win11 Notepad, and did a file/saveas, navigated into a nested 
> folder, just right-click on any folder while still in that saveas 
> process and the context menu includes "copy as path" which places the 
> full path (even for UNC shares) to the clipboard.

Are you on Windows 10 or Windows 11? I trust your observation, so I looked
it up and it turns out Windows 11 really does behave differently here.

In Windows 10, Copy as path isn't a default menu item. It exists, but only
shows up if you hold Shift while right-clicking in Explorer or in a
Save/Open dialog.

In Windows 11, Microsoft changed this. For Windows 11, apparently, "Copy as
path" is now a built-in, always-present verb. That applies not only in File
Explorer, but also in the Common File Dialog (the Save/Open dialog used by
Notepad, IrfanView, Firefox, etc.), since they all host the same shell
view.

I hadn't realized this until I dug into why you see it and I don't.

If we want Windows 10 to behave more like Windows 11, this registry tweak
removes the "Shift-only" restriction and makes Copy as path always visible:

 Windows Registry Editor Version 5.00

 ; --- Always show "Copy as path" on right-click ---
 [HKEY_CLASSES_ROOT\AllFilesystemObjects\shell\windows.copyaspath]
 "NeverDefault"=-

This affects both File Explorer and Common File Dialogs, so my Windows 10
menus will match what you're seeing in Windows 11. To revert, just restore
the NeverDefault value.

Thanks for bringing up this difference between Windows 10 & Windows 11,
which I had not realized existed until you & Herbert brought it up here.

Note also though that the registry tweaks in the OP handle 3 menu items.
   Rightclick: [Copy Path to Clipboard]
               [Open CLI Window Here]
               [Open File Explorer Here]
-- 
We can all learn from each other as we strive to improve our knowledge.

[toc] | [prev] | [next] | [standalone]


#2952

FromMarion <mariond@facts.com>
Date2025-10-29 11:48 -0600
Message-ID<10dtk1l$1fh7$1@nnrp.usenet.blueworldhosting.com>
In reply to#2939
It turns out, thanks to Andy, Herbert & Rudy, that Windows 10 is DIFFERENT
than Windows 11 in that the specific save-path-to-clipboard right-click in
the middle of a save from modern app-included Windows filesystem browsers
exist, by default, in Windows 11 but not in Windows 10 (by default).

Hence, this registry script will be most useful to Windows 10 owners for
that particular feature, and useful to both Win10/Win11 for the others.

   Rightclick anywhere when in the middle of saving a file:
    [Copy Path to Clipboard]
    [Open CLI Window Here]
    [Open File Explorer Here]

 Windows Registry Editor Version 5.00
 
 ; --- Open File Explorer Here ---
 [HKEY_CLASSES_ROOT\Directory\Background\shell\OpenExplorerHere]
 @="Open File Explorer Here"
 "Icon"="imageres.dll,-5302"
 
 [HKEY_CLASSES_ROOT\Directory\Background\shell\OpenExplorerHere\command]
 @="explorer.exe %V"
 
 ; --- Open Command Window Here ---
 [HKEY_CLASSES_ROOT\Directory\Background\shell\OpenCmdHere]
 @="Open Command Window Here"
 "Icon"="imageres.dll,-5324"
 
 [HKEY_CLASSES_ROOT\Directory\Background\shell\OpenCmdHere\command]
 @="cmd.exe /k cd /d %V"
 
 ; --- Copy Path to Clipboard ---
 [HKEY_CLASSES_ROOT\Directory\Background\shell\CopyPath]
 @="Copy Path to Clipboard"
 "Icon"="imageres.dll,-5302"
 
 [HKEY_CLASSES_ROOT\Directory\Background\shell\CopyPath\command]
 @="cmd.exe /c echo \"%V\" | clip"
 
-- 
I am not here for my ego; nor for my amusement; but to teach & learn.

[toc] | [prev] | [standalone]


Back to top | Article view | alt.comp.microsoft.windows


csiph-web