1.

Solve : Batch file stops running if it launches an exe file?

Answer»

Hello!

I've made a BATCH file to repair and re-register the WMI. The batch file is the following:

rundll32 wbemupgd, UpgradeRepository
cd /d %windir%\system32\wbem
for %%i in (*.dll) do RegSvr32 -s %%i
for %%i in (*.exe) do %%i /RegServer

In the fourth line, it launches the wbemtest.exe that has a GUI, and the batch file does not go on RUNNING until I close the wbemtest.exe GUI. It is quite annoying because I WANT the batch file to run as a scheduled task and I do not want to press buttons.
Plus, I've before made batch files that launches other exe files without GUI and these bactch files also suspend running till the exe files are closed, and I sometimes need to run several exe files at the same TIME without closing any of them. So:

Is there any way to make a batch file continue running when it launches an exe file?

Thanks for help in advance.I'm not the foremost expert, but I believe the problem is that, by default, scripts are run synchronously. That means, each step in the script must finish before the next step starts.

The "start" command was created to run steps asynchronously:

start

For example, to run notepad (on a file called mytest.txt) asynchronously, you would TYPE:

start notepad.exe mytest.txt

Running things asynchronously, particularly things with GUIs, can be very ... tricky. If you have a large number of things, it could really bog down your computer. If they have GUIs, all of the GUIs will open at the same time. Either way, your computer could become very difficult to use.

good luckThanks for this useful info.

Do you know a way to run the batch file mentioned above completely without having closed the wbemtest.exe GUI?



Discussion

No Comment Found