Launch a program from command line without opening

2019-01-12 02:50发布

I'm trying to programatically execute a external file from CMD using this comand:

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 programs without opening a new window?

8条回答
别忘想泡老子
2楼-- · 2019-01-12 03:16

I got it working from qkzhu but instead of using MAX change it to MIN and window will close super fast.

@echo off
cd "C:\Program Files (x86)\MySQL\MySQL Server 5.6\bin"
:: Title not needed:
start /MIN  mysqld.exe
exit
查看更多
Summer. ? 凉城
3楼-- · 2019-01-12 03:22

Add /B, as documented in the command-line help for start:

C:\>start /?
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.
B           Start application without creating a new window. The
            application has ^C handling ignored. Unless the application
            enables ^C processing, ^Break is the only way to interrupt
            the application.
查看更多
登录 后发表回答