I have these two lines in my batch script:
call pre.bat
call post.bat
And I have a exit condition in pre.bat (i.e. exit 255)
How can I execute post.bat even if pre.bat exits with an error code?
Use exit /b 255 instead of exit 255 in your pre.bat
If you cannot change pre.bat, then you can use start /b /wait pre.bat instead of call pre.bat. But then all changes to environment variables that pre.bat might have made will be lost.
pre.bat?