I\'m trying to programmatically execute an external file from cmd
using this command:
START \"filepath\"
Where \"filepat
You can use the call
command...
Type: call /?
Usage: call [drive:][path]filename [batch-parameters]
For example call "Example File/Input File/My Program.bat"
[This is also capable with calling files that have a .exe, .cmd, .txt, etc.
NOTE: THIS COMMAND DOES NOT ALWAYS WORK!!!
Not all computers are capable to run this command, but if it does work than it is very useful, and you won't have to open a brand new window...
In Windows 7+ the first quotations will be the title to the cmd
window to open the program:
start "title" "C:\path\program.exe"
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.
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
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.
1-Open you folder that contains your application in the File Explorer. 2-Press SHIFT and Right Click in White Space. 3-Click on "Open command window here". 4-Run your application. (you can type some of the first characters of application name and press Up Arrow Key OR Down Arrow Key)
20190907
OS: Win 10
I'm making an exe in c++, for some reason usting START make my program fail.
So, just use quotes:
"c:\folder\program.exe"