如何在不打开新cmd窗口的情况下从命令行启动程序? [英] How do I launch a program from command line without opening a new cmd window?

查看:356
本文介绍了如何在不打开新cmd窗口的情况下从命令行启动程序?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用以下命令从 cmd 以编程方式执行外部文件:

I'm trying to programmatically execute an external file from cmd using this command:

START "filepath"

其中文件路径 是我文件的路径。它可以很好地打开,但是它还会打开一个新的命令提示符窗口。

Where "filepath" is the path of my file. It opens fine but it also open a new command prompt window.

那么,在不打开新窗口的情况下打开外部程序的正确命令是什么?

So, which is the right command for opening an external program without opening a new window?

推荐答案

在Windows 7+中,第一个引号是 cmd 打开程序的窗口:

In Windows 7+ the first quotations will be the title to the cmd window to open the program:

start "title" "C:\path\program.exe"

像上面那样格式化命令会临时打开 cmd 窗口会尽快消失,所以您真的看不到它。它还允许您打开多个程序,而无需等待第一个程序先关闭。

Formatting your command like the above will temporarily open a cmd window that goes away as fast as it comes up so you really never see it. It also allows you to open more than one program without waiting for the first one to close first.

这篇关于如何在不打开新cmd窗口的情况下从命令行启动程序?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆