标题说明了一切。
这有效:
start "C:\Program Files\Microsoft Office\root\Office16\excel.exe" "c:\folder\file.xlsx"
但这不是:
start "C:\Program Files\Microsoft Office\root\Office16\excel.exe" "D:\folder\file.xlsx"
任何帮助将不胜感激!
第一个命令根本没有采用excel的路径。等于只键入xls文件路径。该文件使用默认程序打开。因为,第一个参数是命令窗口的标题。请参阅启动命令的帮助:
Starts a separate window to run a specified program or command.
START ["title"] [/D path] [/I] [/MIN] [/MAX] [/SEPARATE | /SHARED]
[/LOW | /NORMAL | /HIGH | /REALTIME | /ABOVENORMAL | /BELOWNORMAL]
[/NODE <NUMA node>] [/AFFINITY <hex affinity mask>] [/WAIT] [/B]
[command/program] [parameters]
"title" Title to display in window title bar.
path Starting directory.
理想情况下,命令应为start "Some title" [path to excel] [path to file]