| 1. |
Solve : Batch file "IF" error "GoTo" EOF commandline? |
|
Answer» Hi, I didn't know this forum existed until today, how awesome!! The batch file has four commands, three of which are to a game engine required to compile maps.Since we are not telepaths, the actual code would make the task of deciding if we can help a lot easier. You can clean up personal references or sensitive stuff. Sorry, I didn't think that the path and filename specifics would make a difference. Code: [Select]"C:\MOHAAT~1\Q3map.exe" -v -gamedir C:\Games\MOHAA C:\Games\MOHAA\main\maps\skybox "C:\MOHAAT~1\Q3map.exe" -vis -fast -gamedir C:\Games\MOHAA C:\Games\MOHAA\main\maps\skybox "C:\MOHAAT~1\MOHlight.exe" -fast -gamedir C:\Games\MOHAA C:\Games\MOHAA\main\maps\skybox "C:\Program Files (x86)\Microsoft VISUAL Studio\VB98\My Projects\Map Mate\041\done.exe" As I said, the batch works well except when error occurs with either stage of the compile (first three command lines)You could check for the exit code from the apps you are running, Q3map.exe and MOHlight.exe, assuming that they give a nonzero exit code when the errors of which you speak occur. Do these programs give console output? You could try something like this using the && (zero ERRORLEVEL) and || (nonzero errorlevel) tests Code: [Select]Echo Starting sequence... echo Starting task 1 of 3 "C:\MOHAAT~1\Q3map.exe" -v -gamedir C:\Games\MOHAA C:\Games\MOHAA\main\maps\skybox && (echo OK) || (goto error) echo starting task 2 of 3 "C:\MOHAAT~1\Q3map.exe" -vis -fast -gamedir C:\Games\MOHAA C:\Games\MOHAA\main\maps\skybox && (echo OK) || (goto error) echo Starting task 3 of 3 "C:\MOHAAT~1\MOHlight.exe" -fast -gamedir C:\Games\MOHAA C:\Games\MOHAA\main\maps\skybox && && (echo OK) || (goto error) goto done :error echo ERROR :done "C:\Program Files (x86)\Microsoft Visual Studio\VB98\My Projects\Map Mate\041\done.exe"Correction (accidentally doubled the &&) Code: [Select]echo Starting task 3 of 3 "C:\MOHAAT~1\MOHlight.exe" -fast -gamedir C:\Games\MOHAA C:\Games\MOHAA\main\maps\skybox && (echo OK) || (goto error)Sorry for not getting back to this sooner, life got in the way. Thank you, I will give that a try. edit: Sorry I skipped this.. Quote from: Salmon Trout on January 07, 2017, 07:20:39 AM .........Yes, they do, for several minutes.Whoohoo!! It worked perfectly. Thank you, Salmon Trout. Sorry, I don't have any erroneous maps so I had to ask around for some so I could test the bat. lolI can't see how to mark the thread as "Resolved". |
|