Currently, I am trying to trigger a second task to run when my first task (which runs a minimised batch file) ends. In the first task, I am running cmd.exe
with the arguments /c start "" /min "C:\Custom Scripts\Test.bat" ^& exit
. While this does launch the batch file minimised, as well as another cmd window which is open for a split-second, the arguments being immediately executed and then terminating means that the first task "completes" almost immediately after it opens, regardless of how long the batch file/second window continues to run for.
Conversely, if I change the arguments to /c start "" /min /wait "C:\Custom Scripts\Test.bat" ^& exit
, then the first command window which launches the batch file will not close until the second minimised window does, and so the task does not complete/stop running until the batch file does. However, this also means that the first window is not minimised, which defeats the purpose of minimising the batch file.
Therefore, how can I run all opened/new windows minimised (or only open for a split-second), as well as making the scheduled task complete only when the batch file it's opening does?