"internet path" (file:\\\<shortpath><shortfile>) in conext menu

Please check the FAQ (https://www.xyplorer.com/faq.php) before posting a question...
Post Reply
duanerudy
Posts: 3
Joined: 21 Feb 2020 17:39

"internet path" (file:\\\<shortpath><shortfile>) in conext menu

Post by duanerudy »

I see that if you have the 64 bit context menu disabled and the "real System32" context menu enabled (configuration | other | shell integration) when you right-click a file, the context menu gives you the "to clipboard" option and if you click on that, there are options to copy Item Path/Names(s), Item Short Path/Name(s), etc. I'd like to create an option to create a short path with the prefix "file:\\\<shortpath><shortname>" but I don't know if it is possible for me to do this. Have little to no programming experience but can follow directions and tweak. Want to do something like the free "path copy copy" program for windows explorer.

Thanks for any advice!

jupe
Posts: 2801
Joined: 20 Oct 2017 21:14
Location: Win10 22H2 120dpi

Re: "internet path" (file:\\\<shortpath><shortfile>) in conext menu

Post by jupe »

You have asked for file:\\\ but usually a file URI has forward slashes not backslashes, so in the example I will give below I will change that, just modify it if you really did want backslashes, below is a script that should be close to what you want, or close enough you're able to modify it to suit if required:

copytext "file:///" . replace(<curitem_dos>, "\", "/");

Now the "To Clipboard" menu you mentioned, you can't modify, but with that script above you can assign it to a shortcut key, UDC, custom toolbar button, run it from the XY address bar or catalog etc, many places, so just choose a convenient place to run it from (select a file first obviously).

duanerudy
Posts: 3
Joined: 21 Feb 2020 17:39

Re: "internet path" (file:\\\<shortpath><shortfile>) in conext menu

Post by duanerudy »

Hi Jupe--thanks so much for that! And so quickly! For me to link to a local file, I indeed need to use file:\\\ (and then the path and name). But taking that into account, your suggestion worked perfectly!

duanerudy
Posts: 3
Joined: 21 Feb 2020 17:39

Re: "internet path" (file:\\\<shortpath><shortfile>) in conext menu

Post by duanerudy »

Based on your answer, I also figured this out:

copytext "file:///" . replace(replace(<curitem>, "\", "/"), " ", "%20");

Value of doing it this way is it is a bit easier to see the actual location of the file in the link.

So that's cool! Thanks so much!

Post Reply