make windows explorer links open in Linux

Where I work we use an xls spreadsheet that we save to an htm file.  This gets stored on an intranet.  In it are links to various Windows file share locations and files needed for production.  

Excel saves the file link to html which ends up looking like this...
file:///\\serverpath\folder\file.pdf    <--------

The above link works in windows explorer fine.  However in Linux (i.e., Ubuntu, Mint...etc) it cannot open these links.  Changing each link to http:// works, but this is not an option as there are too many links.  

So how can I get the above link format to open using Linux file explorer?  I am open to any suggestions.  

Attached is a demo file with dummy links.  Feel free to edit the links to test in Linux.  Note, this would require a network and access to a Windows file share.
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Gerwin Jansen, EE MVETopic Advisor Commented:
Something to try:

icecom4Author Commented:
@ Gerwin
Excel saves the file link to html which ends up looking like this...
file:///\\serverpath\folder\file.pdf    <--------

We can manually type in the network path using smb, but this is the problem I am trying to fix.  Its too time consuming after a few hundred links.  

So My goal is to get Linux to open up windows local file system links, by some addon, whatever
Steve BinkCommented:
Why don't you postprocess the HTML to change all instances of "file:///" to "smb://"?  You might also need to change the path separator.
The 7 Worst Nightmares of a Sysadmin

Fear not! To defend your business’ IT systems we’re going to shine a light on the seven most sinister terrors that haunt sysadmins. That way you can be sure there’s nothing in your stack waiting to go bump in the night.

icecom4Author Commented:
Because I am not aware of any way to do that. Would that be automated when saving the html with thousands of links?  If I knew a solution to do that I surely would.
Gerwin Jansen, EE MVETopic Advisor Commented:
The main issue with your Excel spreadsheet  / macro is that it is writing absolute file:\\ paths into the html file. These will open just fine on Windows machines but not on Linux, as you know by now.

I can think of these options:
- Modify the Excel macro to write relative paths like ../../file.pdf - this would work both on Windows and Linux
- Modify the Excel macro to write a second file that has smb://server/share in the links
- The file server that hosts the .pdf files - install a web server on that to serve content over http as well - modify Excel macro to write http and/or relative links in the html file

About your intranet: what kind of server are you publishing the html file to? Is it a web server or just a file server that you point your browser to?
icecom4Author Commented:
okay, I was thinking this might have to go the macro route.  I am lost in that regard also, but will see what I can dig up.  

to answer your question, It's being published to an IIS server
Steve BinkCommented:
RE: Gerwin Jansen, #40973518

I like the idea of modifying the macro, if that is in your skill set.  I would go one step further and create an input variable for the path to write.  It could be a plain text box or a drop-down providing static choices.  Have the user make the selection when triggering the macro.

The second option would be just that..  I don't like the idea of writing the file twice, but that is probably the easiest route for you to resolve it immediately.  I don't like the third option.  Dropping a web server on your file server is asking for trouble, IMO.  

My postprocessing idea would essentially be a more complicated version of the second option.  In case you're interested, though, check out sed for Windows.
Gerwin Jansen, EE MVETopic Advisor Commented:
Another option that will work is that you move your linked pdf documents to the web server to a /document folder, similar to /image for example. That way you can use relative paths and will not run into the issue you now have with any OS or browser that you use to view the site.

If you were to modify the file (post processing) using sed that you would have to replace:

file:///\\ with smb:// and
\ with /

In sed:
sed 's/file:\/\/\/\\\\/smb:\/\//g;s/\\/\//g' your.html > yournew.html
(you can test the above command on one of your .html files)

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.