start /min file.exe
uses CreateProcess
API call to start the process, with the adecuated information inside the STARTUPINFO
structure pointed by the lpStartupInfo
argument.
Inside this structure, there is a wShowWindow
member to indicate how to show the window of the started process. Its documentation states
wShowWindow
If dwFlags specifies STARTF_USESHOWWINDOW, this member can be any of
the values that can be specified in the nCmdShow parameter for the
ShowWindow function, except for SW_SHOWDEFAULT. Otherwise, this member
is ignored.
For GUI processes, the first time ShowWindow is called, its nCmdShow
parameter is ignored wShowWindow specifies the default value. In
subsequent calls to ShowWindow, the wShowWindow member is used if the
nCmdShow parameter of ShowWindow is set to SW_SHOWDEFAULT.
That is, you depend on how the started process handles its window management. There is nothing you could do in the start
command to ensure the new window will be minimized.
note: start
command uses CreateProcess
in the case of executable files, but different arguments (a document, a URL, ...) lead to different APIs used (Ex. ShellExecute
or ShellExecuteEx
), but you end in the same problem after following a different path.
note 2: As already commented, in some cases (my case, windows 10, calc.exe
) you start a process and it starts another one. You have not control on the second started process.