[GH-ISSUE #54] Bug: Copy UNC Parent Folder Path does not work with network mapped drives #54

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

Originally created by @ghost on GitHub (Jan 21, 2019).
Original GitHub issue: https://github.com/clechasseur/pathcopycopy/issues/54

Originally assigned to: @clechasseur on GitHub.

I have this network drive mapped to the following path: \ServerName\E$\media
This network location is mapped to drive (E:)
When right-clicking drive (E:) and using PathCopyCopy's Copy UNC Parent Folder Path function directly on the mapped drive icon, logically, in this case, it should copy the path \ServerName\E$ to the clipboard since it is the UNC Parent Folder of \ServerName\E$\media

Well in this case, it does NOT. It only copies the drive letter as is, so E: in this case. So just the letter and the colon, thats it. I do not know if PathCopyCopy is like this by design, but I think this is an issue.

FYI, the paths do have the double slashes, but for some reason, it only shows one once I save my comment.

Originally created by @ghost on GitHub (Jan 21, 2019). Original GitHub issue: https://github.com/clechasseur/pathcopycopy/issues/54 Originally assigned to: @clechasseur on GitHub. I have this network drive mapped to the following path: **_\\ServerName\E$\media_** This network location is mapped to drive (E:) When right-clicking drive (E:) and using PathCopyCopy's _**Copy UNC Parent Folder Path**_ function directly on the mapped drive icon, logically, in this case, it should copy the path **_\\ServerName\E$_** to the clipboard since it is the UNC Parent Folder of **_\\ServerName\E$\media_** Well in this case, it does NOT. It only copies the drive letter as is, so **_E:_** in this case. So just the letter and the colon, thats it. I do not know if PathCopyCopy is like this by design, but I think this is an issue. FYI, the paths do have the double slashes, but for some reason, it only shows one once I save my comment.
kerem 2026-02-25 21:32:32 +03:00
Author
Owner

@clechasseur commented on GitHub (Jan 22, 2019):

I can sorta reproduce this. Can you validate this: is \\ServerName\E$ a valid share in itself? If you try to open it, does it work?

<!-- gh-comment-id:456279027 --> @clechasseur commented on GitHub (Jan 22, 2019): I can sorta reproduce this. Can you validate this: is `\\ServerName\E$` a valid share in itself? If you try to open it, does it work?
Author
Owner

@ghost commented on GitHub (Jan 22, 2019):

Yes, it is absolutely a valid share.

<!-- gh-comment-id:456283065 --> @ghost commented on GitHub (Jan 22, 2019): Yes, it is absolutely a valid share.
Author
Owner

@clechasseur commented on GitHub (Jan 22, 2019):

I know what's happening. It's not a "bug" in the sense that it is coded to work this way, but I agree that it is misleading. I will fix it.

<!-- gh-comment-id:456287476 --> @clechasseur commented on GitHub (Jan 22, 2019): I know what's happening. It's not a "bug" in the sense that it is coded to work this way, but I agree that it is misleading. I will fix it.
Author
Owner

@ghost commented on GitHub (Jan 22, 2019):

Well technically the E: drive is the Parent Folder Path, but not the UNC Parent Folder Path

<!-- gh-comment-id:456290863 --> @ghost commented on GitHub (Jan 22, 2019): Well technically the E: drive is the Parent Folder Path, but not the UNC Parent Folder Path
Author
Owner

@clechasseur commented on GitHub (Jan 22, 2019):

Exactly. The command currently fetches the path to the parent folder on disk, then fetches that path's UNC equivalent. The problem is that if you use this on a root drive, it doesn't work.

<!-- gh-comment-id:456377912 --> @clechasseur commented on GitHub (Jan 22, 2019): Exactly. The command currently fetches the path to the parent folder on disk, **then** fetches that path's UNC equivalent. The problem is that if you use this on a root drive, it doesn't work.
Author
Owner

@ghost commented on GitHub (Jan 23, 2019):

Well, you seem to know how to make it work. Overall though, you developed a good product here. Props.

<!-- gh-comment-id:456681130 --> @ghost commented on GitHub (Jan 23, 2019): Well, you seem to know how to make it work. Overall though, you developed a good product here. Props.
Author
Owner

@clechasseur commented on GitHub (Aug 14, 2019):

Okay, I've had a bit more time to toy with this and ponder the implications. I have decided to leave this as-is. Changing it would be a breaking change, since it changes the core implementation - even if a little misleading.

In order to do what you want, it's possible to create a custom command. Choose "Copy Long UNC Path" as Base Command and in Find/Replace, choose "Use regular expressions" and enter the following expression:

Find what: ^(.*)(\\|/)[^\\/]+(\\|/)?$
Replace with: $1

This should achieve the result you want.

<!-- gh-comment-id:521068913 --> @clechasseur commented on GitHub (Aug 14, 2019): Okay, I've had a bit more time to toy with this and ponder the implications. I have decided to leave this as-is. Changing it would be a breaking change, since it changes the core implementation - even if a little misleading. In order to do what you want, it's possible to create a custom command. Choose "Copy Long UNC Path" as Base Command and in Find/Replace, choose "Use regular expressions" and enter the following expression: Find what: `^(.*)(\\|/)[^\\/]+(\\|/)?$` Replace with: `$1` This should achieve the result you want.
Author
Owner

@ghost commented on GitHub (Sep 5, 2019):

Charles, I did as you suggested and it works, so I think this is perfectly fine. A bit unorthodox, but works as required. Its a good workaround, and since its a custom command, I just named it "Copy Mapped Drive UNC Parent Folder Path". So it still all makes sense.

<!-- gh-comment-id:528440030 --> @ghost commented on GitHub (Sep 5, 2019): Charles, I did as you suggested and it works, so I think this is perfectly fine. A bit unorthodox, but works as required. Its a good workaround, and since its a custom command, I just named it "Copy Mapped Drive UNC Parent Folder Path". So it still all makes sense.
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#54
No description provided.