| 1. |
Solve : Menu with run all ?? |
|
Answer» Here is my Menu code: 5 will be Quit, 4 will run 1 for 20 minutes and stop running (exit), then run 2 for 20 minutes and stop running, then 3 and running for 20 minuts and quit. Option 4 will run sequentially as you REQUESTED. Menu Code: Code: [Select]@echo off D: CD \Example\Samples goto menu :menu echo. echo What would you like to do? echo. echo Choice echo. echo 1 Run AntiAlias echo 2 Run HDRLighting echo 3 Run ShadowMap echo 4 Run All echo 5 Quit echo. :choice set /P C=[1,2,3,4]? if "%C%"=="5" goto quit if "%C%"=="4" goto All if "%C%"=="3" goto ShadowMap if "%C%"=="2" goto HDRLighting if "%C%"=="1" goto AntiAlias goto choice :AntiAlias start AntiAlias.exe goto menu :HDRLighting start HDRLighting.exe goto menu :ShadowMap start ShadowMap.exe goto menu :All start Wait.bat AntiAlias.exe AntiAlias.exe start Wait.bat HDRLighting.exe HDRLighting.exe start Wait.bat ShadowMap.exe ShadowMap.exe goto menu :quit exit :end You will also need this second batch file (wait.bat): Wait Code: Code: [Select]sleep 1200 for /f %%x in ('tasklist /fi "imagename eq %1"') do ( taskkill /f /im %1 ) Using the start command creates separate threads and an additional layer of complexity. Good luck. 8-)How do you do wait batch with all the kill threat ?I should have mentioned that the sleep command can be found in the Win 2003 Resource Kit. According to my pre-No Child Left Behind math 1200 seconds is 20 minutes. One problem is neither window has a clue what the other is doing. If one of the executables ends early, the wait window will continue to wait and launch a kill for a task that doesn't exist, another wait window will get started along with a new executable. Slowly the entire run unit will unravel. Why can you not let each job run to completion? 8-) |
|