I'm trying to make a script in PowerShell which calls a .bat (& .\test.bat) and this .bat needs to execute a .exe (or many), wait a timeout, and kill it (or them).
For this purpose I did (in a loop):
start %1
timeout 5 > nul
taskkill /f /im %1
exit 0
Everything is launched and the timeout is good but the cmd is never closed.
How could I do it?