[英]Batch: Open a specific file in a specific program?
当记事本是 .txt 文件的默认程序时,我如何告诉 Windows 在写字板中打开 C:\\test\\test.txt?
The accepted answer didn't work for me.接受的答案对我不起作用。 I am not sure if it was because of the program I was trying to run, or because the path had spaces in (even though I wrapped it in quotes), or something else.
我不确定是因为我试图运行的程序,还是因为路径中有空格(即使我用引号将其包裹起来),还是其他原因。
Anyway, I was able to do it be adding an empty string after the start
command.无论如何,我能够通过在
start
命令之后添加一个空字符串来做到这一点。
For example:例如:
start "" "C:\My Programs\myprogram.exe" "C:\My Files\myfile.txt"
您可以将直接路径添加到可执行文件,如
start C:\Windows\System32\write.exe [FILE]
尝试:
start wordpad c:\test\test.txt
There is no need to use start
when using write.exe
, so simply:使用
write.exe
时不需要使用start
,所以简单:
write [FILE(S)]
write.exe
is located in C:\\Windows\\System32
. write.exe
位于C:\\Windows\\System32
。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.