How to get Linux to understand/translate windows shared drive letters links

Posted on 2011-05-10
Last Modified: 2012-05-11
Hi there,
this issue is a little hard to explain so bear with me. We have a windows network powered by a single Windows 2003 server. On that server are a number of folders shared to everyone in the company. There is also a logon script for the windows machines that maps those drives to drive letters locally. So there is an E drive, F drive etc.
Frequently the boss or someone else will email a link to a document referencing  one of those drives, like E:\somefolder\mydoc.doc.

So, the question is, is there any way I can get Ubuntu or Mac machines to see that link, convert it to a more friendly network share like \\servername\sharename\somefolder\mydoc.doc so that they are clickable?

This I think is the final step in finally ditching windows for Ubuntu/Fedora and Mac for a sizeable number in my company so any help would be much appreciated.
Question by:Slimshaneey
    LVL 8

    Expert Comment

    Hi there,

    you could put a script in the internal mail flow to translate such links, but this script
    most likely will not get everything right and so be just a compromise.

    Another way might be to mount the shared drives on the linux and mac boxes
    and then put a symlink in the path of the users like

    ln -s b: /smb/someserver/somedirectory

    This, if \ are exchanged with / when writing mails, might work.

    LVL 87

    Accepted Solution

    For one thing, most Linux browsers (like Konqueror etc), allow you to access shared files and folders directly by using the following syntax in the address bar:


    You will of course have to supply your username and password.

    The filemanager also normally have a "Network" option from which you can directly access those files or folders after logging in.

    Or you can mount the shares to different Linux folders and access them that way, ie:

    sudo mount -t cifs username=UserName //IPOfServer/ShareName /media/FolderNameToMountTheShareOn
    LVL 11

    Author Comment

    Thanks guys. I was hoping for something a little more elegant than "the user needs to write the links different". Im dealing with non-tech people who resist change at every turn. I was hoping for something like a way to intercept the protocol call, so it sees E:\something and doesnt know what to do, how would I tell it that I want say, this script to run which will translate the call into a nautilus command. Is that possible?
    LVL 11

    Author Comment

    Ah, just thinking about this, is this something I could do with Wine? So configure each of the drives in wine mapping the network drives to drive letters matching the windows machines, is there someway to then tell ubuntu to be able to see those E:\ drives as Wine drives?
    LVL 87

    Expert Comment

    Wine isn't elegant and you would only be able to use those shares with Windows apps run within wine. In Linux just forget those stupid Drive Letters, they are very limited and therefore not elegant. The most "Elegant" way would be to just mount the shares and then access them directly as if they were on the Local Linux file-System like I mentioned above.
    LVL 7

    Assisted Solution


    You need wine installed, then you can go for 'winepath' command :

    LVL 8

    Assisted Solution

    There are several different problems here.  

    Drive letters:  You can map drive letters to specific file systems by doing the following:
      $  sudo mkdir /E:
      $  sudo mount server:/share /E:
      (You might need to use the mount command which rindl suggested.)

    This assumes that the mapping between E: and a specific share is consistent across all machines, as is generally the case.

    This allows you to access E:/somefolder/mydoc.doc which should be the same as on your Windows system.

    This brings us to the second problem.  Windows uses back slashes in it's paths, while Linux uses forward slashes.  Worse, backslashes are interpreted as escape characters and are either converted to special characters or discarded when passed to a program.  It isn't difficult to translate the path by hand or within a bash or perl program, but I'm not aware of any email reader or web browser which does this automatically. Possibly there is an extension, but I'm not aware of one.

    If people are willing to copy a link from email and paste it, you could write a small GUI frontend to Nautilus which translated the path and passes it along to the program.  It isn't easy to do this with a CLI command, since Bash will gobble up the back slashes.  

    The third problem is handling \\servername\path.  If you can get past the path translation problem, you can use automount to connect to servername:/path.
    LVL 11

    Author Closing Comment

    Thanks for the help, never did find a workable solution but thank you for the input anyway!

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Enabling OSINT in Activity Based Intelligence

    Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

    If you have a server on collocation with the super-fast CPU, that doesn't mean that you get it running at full power. Here is a preamble. When doing inventory of Linux servers, that I'm administering, I've found that some of them are running on l…
    It’s 2016. Password authentication should be dead — or at least close to dying. But, unfortunately, it has not traversed Quagga stage yet. Using password authentication is like laundering hotel guest linens with a washboard — it’s Passé.
    Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
    Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…

    759 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    12 Experts available now in Live!

    Get 1:1 Help Now