Forum Discussion
sylvainrodrigue
Apr 10, 2019Brass Contributor
How the new Edge will handle file:// URI ?
file: links seems to be ignored in this version of Edge (like they are in Chrome). In the previous version of Edge however (and all IE versions), clicking on a file: link opens the original document....
Kaseebhotla
Aug 17, 2021Copper Contributor
Marty, I tried this. It's succeeding in opening explorer.exe but the file itself is not being opened. What does %1 hold when assigned to $val? Is it the entire URL? If yes, shouldn't the substring only exclude the first 7 characters ("myfile:")? Thank you!
MartyMiller
Dec 19, 2022Copper Contributor
Kaseebhotla Yes, it is the entire URL. My custom protocol name is 7 characters, and I'm also stripping off the "://" characters. The remainder of the URL is the UNC path to the file.
- MartyMillerDec 19, 2022Copper ContributorMy appologies. The typo is the substring index I posted on this discussion. My actual protocol name is 7. Using "MyFile" the substring should look like this... $val.Substring(9, $val.length - 9)
- KaseebhotlaDec 19, 2022Copper ContributorYou have a typo. Your custom protocol "MyFile" is 6 characters.
I believe your original solution should have the last line as follows:
@="powershell.exe -Command \"$val='%1'; $val = $val.Substring(7, $val.length - 7).TrimEnd('/').Replace('/','\\'); & 'EXPLORER.EXE' $val\""