Ubuntu中某些程序无法打开网络共享文件

本文介绍了解决Ubuntu系统中程序无法打开网络共享文件的问题。通过修改对应.desktop文件中的Exec参数,如从%U更改为%F,可以有效解决Rhythmbox等软件无法访问网络路径的情况。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

在 ubuntu 中有很多程序打开网络共享文件,无法打开或者明确提示无法打开。一个很有可能的原因是在 /usr/share/applications 中对应的 desktop 文件中 Exec 项中的参数不对。(含有汉字的路径或者含有汉字的文件名也需要这样处理)

例如:
Rhythmbox音乐播放器 无法打开 smb://音乐/三环边上.wma
处理方法
sudo gedit /usr/share/applications/rhythmbox.desktop
把其中的
Exec=rhythmbox %U
改为
Exec=rhythmbox %F
即可。

常用的参数有:%f %F %u %U,解释如下:
%f 
   A single file name, even if multiple files are selected. The system reading the desktop entry should recognize that the program in question cannot handle multiple file arguments, and it should should probably spawn and execute multiple copies of a program for each selected file if the program is not able to handle additional file arguments. If files are not on the local file system (i.e. are on HTTP or FTP locations), the files will be copied to the local file system and %f will be expanded to point at the temporary file. Used for programs that do not understand the URL syntax.
    单个文件名,即使选择了多个文件。如果已选择的文件不在本地文件系统中(比如说在HTTP或者FTP上),这个文件将被作为一个临时文件复制到本地,%f将指向本地临时文件;

%F    A list of files. Use for apps that can open several local files at once. Each file is passed as a separate argument to the executable program.
    文件列表。用于程序可以同时打开多个本地文件。每个文件以分割段的方式传递给执行程序。

%u    A single URL. Local files may either be passed as file: URLs or as file path.
    单个URL。本地文件以文件URL或文件路径的方式传递。

%U    A list of URLs. Each URL is passed as a separate argument to the executable program. Local files may either be passed as file: URLs or as file path.
    URL列表。每个URL以分割段的方式传递给执行程序。本地文件以文件URL或文件路径的方式传递。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值