How can I open files with spaces in their names via wine app?
I have .desktop file for a wine-like app that opens MS Word:
[Desktop Entry]
Type=Application
Version=1.0
Icon=x-vmware-564d5302e9430a5d-1416be4d2596d246-Microsoft-Word-2010
Terminal=false
StartupNotify=false
NoDisplay=false
Name=Microsoft Word
StartupWMClass=Microsoft Word
Exec=vmrun -T player -gu alx -gp 123 runProgramInGuest "/home/alx/vmware/office/windows-7.vmx" -activeWindow -interactive "c:Program Files (x86)Microsoft OfficeOffice14WINWORD.EXE" Z:lin%f
Comment=Run 'Microsoft Word 2010' in the virtual machine 'windows-7'
Name[en_US]=Word
It successfully opens docs, except the docs with names what contain spaces, it shows the error that cannot find such files, and in path it replaces spaces with %%20. Is it possible to somehow say: dono't convert spaces into %20 in file names?
wine launcher .desktop
add a comment |
I have .desktop file for a wine-like app that opens MS Word:
[Desktop Entry]
Type=Application
Version=1.0
Icon=x-vmware-564d5302e9430a5d-1416be4d2596d246-Microsoft-Word-2010
Terminal=false
StartupNotify=false
NoDisplay=false
Name=Microsoft Word
StartupWMClass=Microsoft Word
Exec=vmrun -T player -gu alx -gp 123 runProgramInGuest "/home/alx/vmware/office/windows-7.vmx" -activeWindow -interactive "c:Program Files (x86)Microsoft OfficeOffice14WINWORD.EXE" Z:lin%f
Comment=Run 'Microsoft Word 2010' in the virtual machine 'windows-7'
Name[en_US]=Word
It successfully opens docs, except the docs with names what contain spaces, it shows the error that cannot find such files, and in path it replaces spaces with %%20. Is it possible to somehow say: dono't convert spaces into %20 in file names?
wine launcher .desktop
2
Are you sure it's not theZ:linprefix that's causing the target file to be not found? I'm not sure why you'd need that (I don't use wine), but if you do, the backslash probably needs to be escaped or protected with quotes.
– steeldriver
Aug 13 '15 at 10:46
lin - is shared folder inside Win VM, the path to host files from VM i starting from Z:lin the rest path - is path of file that i am trying to open. so example of file path that opens fine:Z:linhomealxdocsmyword.docxexample of file path that couldnt be opened:Z:linhomealxdocsmy word.docx, so in Word app error shows incorrect file path:Z:linhomealxdocsmy%20word.docx
– Alx Key
Aug 13 '15 at 16:21
ps. funny is that spaces is not a problem for Excel app, it opens files with spaces in names, just with the same .desktop configuration, might be it related to WINWORD app itself?
– Alx Key
Aug 13 '15 at 16:23
add a comment |
I have .desktop file for a wine-like app that opens MS Word:
[Desktop Entry]
Type=Application
Version=1.0
Icon=x-vmware-564d5302e9430a5d-1416be4d2596d246-Microsoft-Word-2010
Terminal=false
StartupNotify=false
NoDisplay=false
Name=Microsoft Word
StartupWMClass=Microsoft Word
Exec=vmrun -T player -gu alx -gp 123 runProgramInGuest "/home/alx/vmware/office/windows-7.vmx" -activeWindow -interactive "c:Program Files (x86)Microsoft OfficeOffice14WINWORD.EXE" Z:lin%f
Comment=Run 'Microsoft Word 2010' in the virtual machine 'windows-7'
Name[en_US]=Word
It successfully opens docs, except the docs with names what contain spaces, it shows the error that cannot find such files, and in path it replaces spaces with %%20. Is it possible to somehow say: dono't convert spaces into %20 in file names?
wine launcher .desktop
I have .desktop file for a wine-like app that opens MS Word:
[Desktop Entry]
Type=Application
Version=1.0
Icon=x-vmware-564d5302e9430a5d-1416be4d2596d246-Microsoft-Word-2010
Terminal=false
StartupNotify=false
NoDisplay=false
Name=Microsoft Word
StartupWMClass=Microsoft Word
Exec=vmrun -T player -gu alx -gp 123 runProgramInGuest "/home/alx/vmware/office/windows-7.vmx" -activeWindow -interactive "c:Program Files (x86)Microsoft OfficeOffice14WINWORD.EXE" Z:lin%f
Comment=Run 'Microsoft Word 2010' in the virtual machine 'windows-7'
Name[en_US]=Word
It successfully opens docs, except the docs with names what contain spaces, it shows the error that cannot find such files, and in path it replaces spaces with %%20. Is it possible to somehow say: dono't convert spaces into %20 in file names?
wine launcher .desktop
wine launcher .desktop
edited Jan 3 at 20:10
Zanna
50.2k13133241
50.2k13133241
asked Aug 13 '15 at 4:45
Alx KeyAlx Key
163
163
2
Are you sure it's not theZ:linprefix that's causing the target file to be not found? I'm not sure why you'd need that (I don't use wine), but if you do, the backslash probably needs to be escaped or protected with quotes.
– steeldriver
Aug 13 '15 at 10:46
lin - is shared folder inside Win VM, the path to host files from VM i starting from Z:lin the rest path - is path of file that i am trying to open. so example of file path that opens fine:Z:linhomealxdocsmyword.docxexample of file path that couldnt be opened:Z:linhomealxdocsmy word.docx, so in Word app error shows incorrect file path:Z:linhomealxdocsmy%20word.docx
– Alx Key
Aug 13 '15 at 16:21
ps. funny is that spaces is not a problem for Excel app, it opens files with spaces in names, just with the same .desktop configuration, might be it related to WINWORD app itself?
– Alx Key
Aug 13 '15 at 16:23
add a comment |
2
Are you sure it's not theZ:linprefix that's causing the target file to be not found? I'm not sure why you'd need that (I don't use wine), but if you do, the backslash probably needs to be escaped or protected with quotes.
– steeldriver
Aug 13 '15 at 10:46
lin - is shared folder inside Win VM, the path to host files from VM i starting from Z:lin the rest path - is path of file that i am trying to open. so example of file path that opens fine:Z:linhomealxdocsmyword.docxexample of file path that couldnt be opened:Z:linhomealxdocsmy word.docx, so in Word app error shows incorrect file path:Z:linhomealxdocsmy%20word.docx
– Alx Key
Aug 13 '15 at 16:21
ps. funny is that spaces is not a problem for Excel app, it opens files with spaces in names, just with the same .desktop configuration, might be it related to WINWORD app itself?
– Alx Key
Aug 13 '15 at 16:23
2
2
Are you sure it's not the
Z:lin prefix that's causing the target file to be not found? I'm not sure why you'd need that (I don't use wine), but if you do, the backslash probably needs to be escaped or protected with quotes.– steeldriver
Aug 13 '15 at 10:46
Are you sure it's not the
Z:lin prefix that's causing the target file to be not found? I'm not sure why you'd need that (I don't use wine), but if you do, the backslash probably needs to be escaped or protected with quotes.– steeldriver
Aug 13 '15 at 10:46
lin - is shared folder inside Win VM, the path to host files from VM i starting from Z:lin the rest path - is path of file that i am trying to open. so example of file path that opens fine:
Z:linhomealxdocsmyword.docx example of file path that couldnt be opened: Z:linhomealxdocsmy word.docx, so in Word app error shows incorrect file path: Z:linhomealxdocsmy%20word.docx– Alx Key
Aug 13 '15 at 16:21
lin - is shared folder inside Win VM, the path to host files from VM i starting from Z:lin the rest path - is path of file that i am trying to open. so example of file path that opens fine:
Z:linhomealxdocsmyword.docx example of file path that couldnt be opened: Z:linhomealxdocsmy word.docx, so in Word app error shows incorrect file path: Z:linhomealxdocsmy%20word.docx– Alx Key
Aug 13 '15 at 16:21
ps. funny is that spaces is not a problem for Excel app, it opens files with spaces in names, just with the same .desktop configuration, might be it related to WINWORD app itself?
– Alx Key
Aug 13 '15 at 16:23
ps. funny is that spaces is not a problem for Excel app, it opens files with spaces in names, just with the same .desktop configuration, might be it related to WINWORD app itself?
– Alx Key
Aug 13 '15 at 16:23
add a comment |
1 Answer
1
active
oldest
votes
Alright, I sorted it out.
To correctly open MS Word docs including files with spaces in their names, we need to do 2 things:
- create a sh wrapper that will start WINWORD app with correct parameters:
#!/bin/sh
vmrun -T player -gu alx -gp 123 runProgramInGuest ./vmware/office/windows-7.vmx -activeWindow -interactive "c:Program Files (x86)Microsoft OfficeOffice14WINWORD.EXE" "$(echo "$@" |sed -e 's;C:;Z:;' -e 's:/*/:\\:g')"
- Modify the Exec line in the
.desktopfile to point to the wrapper above:
Exec=./bin/wordwrapper.sh Z:\lin%F
Where lin - shared folder inside windows VM for accessing host machine files, in case of Wine, there should be only Z:%F
add a comment |
Your Answer
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "89"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f660813%2fhow-can-i-open-files-with-spaces-in-their-names-via-wine-app%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
Alright, I sorted it out.
To correctly open MS Word docs including files with spaces in their names, we need to do 2 things:
- create a sh wrapper that will start WINWORD app with correct parameters:
#!/bin/sh
vmrun -T player -gu alx -gp 123 runProgramInGuest ./vmware/office/windows-7.vmx -activeWindow -interactive "c:Program Files (x86)Microsoft OfficeOffice14WINWORD.EXE" "$(echo "$@" |sed -e 's;C:;Z:;' -e 's:/*/:\\:g')"
- Modify the Exec line in the
.desktopfile to point to the wrapper above:
Exec=./bin/wordwrapper.sh Z:\lin%F
Where lin - shared folder inside windows VM for accessing host machine files, in case of Wine, there should be only Z:%F
add a comment |
Alright, I sorted it out.
To correctly open MS Word docs including files with spaces in their names, we need to do 2 things:
- create a sh wrapper that will start WINWORD app with correct parameters:
#!/bin/sh
vmrun -T player -gu alx -gp 123 runProgramInGuest ./vmware/office/windows-7.vmx -activeWindow -interactive "c:Program Files (x86)Microsoft OfficeOffice14WINWORD.EXE" "$(echo "$@" |sed -e 's;C:;Z:;' -e 's:/*/:\\:g')"
- Modify the Exec line in the
.desktopfile to point to the wrapper above:
Exec=./bin/wordwrapper.sh Z:\lin%F
Where lin - shared folder inside windows VM for accessing host machine files, in case of Wine, there should be only Z:%F
add a comment |
Alright, I sorted it out.
To correctly open MS Word docs including files with spaces in their names, we need to do 2 things:
- create a sh wrapper that will start WINWORD app with correct parameters:
#!/bin/sh
vmrun -T player -gu alx -gp 123 runProgramInGuest ./vmware/office/windows-7.vmx -activeWindow -interactive "c:Program Files (x86)Microsoft OfficeOffice14WINWORD.EXE" "$(echo "$@" |sed -e 's;C:;Z:;' -e 's:/*/:\\:g')"
- Modify the Exec line in the
.desktopfile to point to the wrapper above:
Exec=./bin/wordwrapper.sh Z:\lin%F
Where lin - shared folder inside windows VM for accessing host machine files, in case of Wine, there should be only Z:%F
Alright, I sorted it out.
To correctly open MS Word docs including files with spaces in their names, we need to do 2 things:
- create a sh wrapper that will start WINWORD app with correct parameters:
#!/bin/sh
vmrun -T player -gu alx -gp 123 runProgramInGuest ./vmware/office/windows-7.vmx -activeWindow -interactive "c:Program Files (x86)Microsoft OfficeOffice14WINWORD.EXE" "$(echo "$@" |sed -e 's;C:;Z:;' -e 's:/*/:\\:g')"
- Modify the Exec line in the
.desktopfile to point to the wrapper above:
Exec=./bin/wordwrapper.sh Z:\lin%F
Where lin - shared folder inside windows VM for accessing host machine files, in case of Wine, there should be only Z:%F
edited Jan 3 at 20:11
Zanna
50.2k13133241
50.2k13133241
answered Aug 13 '15 at 19:40
Alx KeyAlx Key
163
163
add a comment |
add a comment |
Thanks for contributing an answer to Ask Ubuntu!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f660813%2fhow-can-i-open-files-with-spaces-in-their-names-via-wine-app%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
2
Are you sure it's not the
Z:linprefix that's causing the target file to be not found? I'm not sure why you'd need that (I don't use wine), but if you do, the backslash probably needs to be escaped or protected with quotes.– steeldriver
Aug 13 '15 at 10:46
lin - is shared folder inside Win VM, the path to host files from VM i starting from Z:lin the rest path - is path of file that i am trying to open. so example of file path that opens fine:
Z:linhomealxdocsmyword.docxexample of file path that couldnt be opened:Z:linhomealxdocsmy word.docx, so in Word app error shows incorrect file path:Z:linhomealxdocsmy%20word.docx– Alx Key
Aug 13 '15 at 16:21
ps. funny is that spaces is not a problem for Excel app, it opens files with spaces in names, just with the same .desktop configuration, might be it related to WINWORD app itself?
– Alx Key
Aug 13 '15 at 16:23