• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 406
  • Last Modified:

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

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.
3 Solutions
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.

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
SlimshaneeyAuthor Commented:
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?
Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

SlimshaneeyAuthor Commented:
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?
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.

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


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.
SlimshaneeyAuthor Commented:
Thanks for the help, never did find a workable solution but thank you for the input anyway!
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now