[Wine] Wine, Gnome, and filenames with spaces

Michael Peek peek at tiem.utk.edu
Tue Nov 17 16:14:44 CST 2009


Hi guys,

I've installed wine-1.1.32 and MS Office 2007 on Ubuntu 9.10 
(Gnome-based desktop).

Many of our existing Windows files have spaces in the filenames.  For 
instance, a file named "Hello World.doc".  When I right-click on this 
file and open it in MSWord, the tool complains that it can't find the 
file "Hello.doc", followed by another complaint that it can't find the 
file "World.doc".

Rather than (a) go through the entire server and rename all of these 
files, and (b) (even harder) try to educate my users not to use spaces 
in their filenames, I thought I would first take a stab at fixing 
things.  The best that I can figure is that this is controlled by 
~/.local/share/applications/wine-*.desktop.  For instance, the contents 
of ~/.local/share/applications/wine-extension-doc.desktop says:

[Desktop Entry]
Type=Application
Name=Microsoft Office Word
MimeType=application/msword
Exec=env WINEPREFIX="/var/lib/radix/.wine-office2007" wine start 
/ProgIDOpen Word.Document.8 %f
NoDisplay=true
StartupNotify=true

So I'm guessing the problem is that the %f is being resolved and then 
passed to a shell that breaks the space in the filename up into separate 
command line arguments, when it should be keeping it whole.

I've tried replacing %f with:
'%f'
"%f"
$(winepath -u "%f")
`winepath -u "%f"`

But none of this seemed to have any effect.

Anyone out there know a fix for this?  Or am I editing the wrong file?

Thanks,

Michael



More information about the wine-users mailing list