当前时区为 UTC + 8 小时



发表新帖 回复这个主题  [ 2 篇帖子 ] 
作者 内容
1 楼 
 文章标题 : 扔给你一个LibreOfficePortable for win 关联程序脚本
帖子发表于 : 2017-01-03 11:13 

注册: 2007-06-22 18:52
帖子: 153
送出感谢: 0 次
接收感谢: 14
警告:该脚本仅在xp系统下测试通过,不保证其他系统有效,出现任何问题,本人概不负责。
用法:复制下列代码,新建一个bat脚本,放置在LibreOfficePortable目录中,双击脚本,按照提示操作。
代码:
@echo off

title Libreoffice关联程序

::pushd %~dp0

mode con cols=77 lines=21

color fc

:list
echo ###########################################
echo # 要关联请程序,请输入1,要删除关联,请输入0 #
echo ###########################################
set /p choice=请输入:

if not defined choice (
   goto list
) else (
   if "%choice%"=="1" goto install
   if "%choice%"=="0" goto remove
)

:install
::关联后缀
assoc .odb=LibreOfficePortable.odb
assoc .odf=LibreOfficePortable.odf
assoc .odg=LibreOfficePortable.odg
assoc .odm=LibreOfficePortable.odm
assoc .odp=LibreOfficePortable.odp
assoc .ods=LibreOfficePortable.ods
assoc .odt=LibreOfficePortable.odt
assoc .otg=LibreOfficePortable.otg
assoc .otp=LibreOfficePortable.otp
assoc .ots=LibreOfficePortable.ots
assoc .ott=LibreOfficePortable.ott

::创建文件类型
ftype LibreOfficePortable.odb="%~dp0LibreOfficeBasePortable.exe -o "%%1"
ftype LibreOfficePortable.odf="%~dp0LibreOfficeMathPortable.exe" -o "%%1"
ftype LibreOfficePortable.odg="%~dp0LibreOfficeDrawPortable.exe" -o "%%1"
ftype LibreOfficePortable.odm="%~dp0LibreOfficeWriterPortable.exe" -o "%%1"
ftype LibreOfficePortable.odp="%~dp0LibreOfficeImpressPortable.exe" -o "%%1"
ftype LibreOfficePortable.ods="%~dp0LibreOfficeCalcPortable.exe" -o "%%1"
ftype LibreOfficePortable.odt="%~dp0LibreOfficeWriterPortable.exe" -o "%%1"
ftype LibreOfficePortable.otg="%~dp0LibreOfficeDrawPortable.exe" -o "%%1"
ftype LibreOfficePortable.otp="%~dp0LibreOfficeImpressPortable.exe" -o "%%1"
ftype LibreOfficePortable.ots="%~dp0LibreOfficeCalcPortable.exe" -o "%%1"
ftype LibreOfficePortable.ott="%~dp0LibreOfficeWriterPortable.exe" -o "%%1"

::文件图标
reg add "HKEY_CLASSES_ROOT\LibreOfficePortable.odb\DefaultIcon" /ve /t REG_SZ /d "%~dp0App\libreoffice\program\soffice.bin,11"
reg add "HKEY_CLASSES_ROOT\LibreOfficePortable.odf\DefaultIcon" /ve /t REG_SZ /d "%~dp0App\libreoffice\program\soffice.bin,12"
reg add "HKEY_CLASSES_ROOT\LibreOfficePortable.odg\DefaultIcon" /ve /t REG_SZ /d "%~dp0App\libreoffice\program\soffice.bin,5"
reg add "HKEY_CLASSES_ROOT\LibreOfficePortable.odm\DefaultIcon" /ve /t REG_SZ /d "%~dp0App\libreoffice\program\soffice.bin,9"
reg add "HKEY_CLASSES_ROOT\LibreOfficePortable.odp\DefaultIcon" /ve /t REG_SZ /d "%~dp0App\libreoffice\program\soffice.bin,7"
reg add "HKEY_CLASSES_ROOT\LibreOfficePortable.ods\DefaultIcon" /ve /t REG_SZ /d "%~dp0App\libreoffice\program\soffice.bin,3"
reg add "HKEY_CLASSES_ROOT\LibreOfficePortable.odt\DefaultIcon" /ve /t REG_SZ /d "%~dp0App\libreoffice\program\soffice.bin,1"
reg add "HKEY_CLASSES_ROOT\LibreOfficePortable.otg\DefaultIcon" /ve /t REG_SZ /d "%~dp0App\libreoffice\program\soffice.bin,6"
reg add "HKEY_CLASSES_ROOT\LibreOfficePortable.otp\DefaultIcon" /ve /t REG_SZ /d "%~dp0App\libreoffice\program\soffice.bin,8"
reg add "HKEY_CLASSES_ROOT\LibreOfficePortable.ots\DefaultIcon" /ve /t REG_SZ /d "%~dp0App\libreoffice\program\soffice.bin,4"
reg add "HKEY_CLASSES_ROOT\LibreOfficePortable.ott\DefaultIcon" /ve /t REG_SZ /d "%~dp0App\libreoffice\program\soffice.bin,2"

#退出
exit

:remove
::删除关联
assoc .odb=
assoc .odf=
assoc .odg=
assoc .odm=
assoc .odp=
assoc .ods=
assoc .odt=
assoc .otg=
assoc .otp=
assoc .ots=
assoc .ott=

::删除文件类型
reg delete "HKEY_CLASSES_ROOT\LibreOfficePortable.odb" /f
reg delete "HKEY_CLASSES_ROOT\LibreOfficePortable.odf" /f
reg delete "HKEY_CLASSES_ROOT\LibreOfficePortable.odg" /f
reg delete "HKEY_CLASSES_ROOT\LibreOfficePortable.odm" /f
reg delete "HKEY_CLASSES_ROOT\LibreOfficePortable.odp" /f
reg delete "HKEY_CLASSES_ROOT\LibreOfficePortable.ods" /f
reg delete "HKEY_CLASSES_ROOT\LibreOfficePortable.odt" /f
reg delete "HKEY_CLASSES_ROOT\LibreOfficePortable.otg" /f
reg delete "HKEY_CLASSES_ROOT\LibreOfficePortable.otp" /f
reg delete "HKEY_CLASSES_ROOT\LibreOfficePortable.ots" /f
reg delete "HKEY_CLASSES_ROOT\LibreOfficePortable.ott" /f

::重新加载外壳
taskkill /f /im explorer.exe
start explorer


页首
 用户资料  
 
2 楼 
 文章标题 : Re: 扔给你一个LibreOfficePortable for win 关联程序脚本
帖子发表于 : 2017-01-06 12:29 

注册: 2010-05-01 21:23
帖子: 1955
送出感谢: 4
接收感谢: 21
LibreOfficePortable 这垃圾安装到u盘,单单安装时间都要几个小时。更别说使用了。


页首
 用户资料  
 
显示帖子 :  排序  
发表新帖 回复这个主题  [ 2 篇帖子 ] 

当前时区为 UTC + 8 小时


在线用户

正在浏览此版面的用户:没有注册用户 和 2 位游客


不能 在这个版面发表主题
不能 在这个版面回复主题
不能 在这个版面编辑帖子
不能 在这个版面删除帖子
不能 在这个版面提交附件

前往 :  
本站点为公益性站点,用于推广开源自由软件,由 DiaHosting VPSBudgetVM VPS 提供服务。
我们认为:软件应可免费取得,软件工具在各种语言环境下皆可使用,且不会有任何功能上的差异;
人们应有定制和修改软件的自由,且方式不受限制,只要他们自认为合适。

Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
简体中文语系由 王笑宇 翻译