命令行打开快捷方式:
按键 win+x,选择powershell。
- 批处理示例
@echo off
REM 调整格式,避免乱码
chcp 65001
REM 指定Word文档的路径
REM set "docPath=C:\path\to\your\document.docx"
set "docPath=D:\supers\TEST\打开文档\123.docx"
REM 检查文档是否存在
if not exist "%docPath%" (
echo 文档不存在: %docPath%
pause
)
REM 调用Microsoft Word打开文档
REM start "" "C:\Program Files\Microsoft Office\root\Office16\WINWORD.EXE" "%docPath%"
rem start "" "C:\Users\Administrator\AppData\Local\Kingsoft\WPS Office\ksolaunch.exe" "%docPath%"
rem start C:\Users\Administrator\AppData\Local\Kingsoft\WPS Office\ksolaunch.exe "%docPath%"
rem start "C:\Users\Administrator\AppData\Local\Kingsoft\WPS Office\" ksolaunch.exe
start "" "%docPath%"
rem pause
REM 退出脚本
exit /b 0
标签:WORD,AppData,Office,docPath%,rem,start,快捷,REM,打开
From: https://www.cnblogs.com/xjxlb/p/18643642