Still I wonder if Powershell approach would allow to avoid restarting the batch from within or using a VBS script file, i.e. would only start hidden microApache, then return control to the batch for other tasks? But its hard to find a suitable example on the web. In Cmd the task is done like this, but it leaves an open program console window:
Code: Select all
@echo off
setlocal EnableExtensions EnableDelayedExpansion
set "img="C:\Program Files (x86)\some_program\microapache\mapache.exe""
set "dir="C:\Program Files (x86)\some_program\microapache""
set "conf=C:/Users/user/AppData/some_program/microApache/httpd_conf.txt"
:: more unrelated code
start "" /d %dir% /b %img% -f %conf% 2>nul
:: more unrelated code
exit /b
What shortest Powershell command would start the program from the batch hidden in the background and return control to the batch once done, ideally without relaunching the batch, using extra files, or notably changing the batch structure, since it performs various other tasks?