怎么命令bat打开某个文件

如题:或文件夹,怎么做

打开文件或文件夹可以用start命令,start命令会根据文件关联的程序自动调用关联的程序打开文件和文件夹.

例如:

start "" "c:\windows"
start explorer "c:\windows"
rem 打开文件夹


start "" "c:\test.doc"
start winword "c:\test.doc"
rem 调用word打开test.doc

 

start "" "c:\test.txt"
start notepad "c:\test.txt"
rem 调用记事本打开test.txt

温馨提示:答案为网友推荐,仅供参考
第1个回答  2017-12-28
start D:\Softwares\BaiduYun\baiduyun.exe 这个命令是启动程序之后返回bat;
去掉start之后:
D:\Softwares\BaiduYun\baiduyun.exe
这个命令在启动程序之后一直等待程序结束,程序结束之后才会返回。
第2个回答  2013-10-12
START 打开文件(批处理会继续执行)
CALL 打开文件(批处理将等待文件执行完毕后再执行自身命令)
START "" C:\ 打开文件夹(此命令打开C盘)
相似回答