【发布时间】:2013-11-25 20:42:22
【问题描述】:
我应该使用什么命令在程序末尾打开指定路径。
start "c:\Yaya\yoyo\"
不工作
【问题讨论】:
标签: batch-file
我应该使用什么命令在程序末尾打开指定路径。
start "c:\Yaya\yoyo\"
不工作
【问题讨论】:
标签: batch-file
你可以这样试试:
%SystemRoot%\explorer.exe "c:\Yaya\yoyo\"
【讨论】:
开始命令需要blank quotes开头,因为它使用第一个双引号短语作为"Window title"
start "" "c:\Yaya\yoyo\"
【讨论】:
explorer ... 选项。
我觉得应该是这样的:
explorer c:/Yaya/yoyo
【讨论】:
c:/Yaya/yoyo 将需要引号。 explorer "c:/Yaya/yoyo"
start "" ... 选项。
这里有两个打开文件夹的例子,一个在 location 中,另一个在父目录中选择文件夹。
:: Open an Explorer window with the 'temp' folder displayed and its parent hidden:
Explorer.exe /e,/root,"%temp%"
:: This one will open the parent directory and automatically select the 'temp' folder:
Explorer.exe /select,"%temp%"
:: See more examples here: https://ss64.com/nt/explorer.html
【讨论】:
打开记事本并输入
START C:\Yaya\yoyo\
另存为:文件名.BAT
编辑:有些人报告了 START 关键字后的字符串,将路径包含在双引号内更好,因为路径可以包含带空格的文件/文件夹名称。
START "" "C:\Yaya\yoyo\"
在较新的系统中,例如,Windows 10 标题会被忽略,因为 CMD 会在眨眼之间打开和关闭。启动新进程的语法是
语法
START "title" [/D path] [options] "command" [parameters]
在哪里
【讨论】:
"" 作为@foxidrives 的答案。
方法一
start "" "your directory or File"
例如:-
start "" "E:\Code SAmple\"
方法 2
%SystemRoot%\explorer.exe "your directory or File"
例如:-
%SystemRoot%\explorer.exe "E:\Code SAmple\"
参考:-
【讨论】: