I am on a Windows 2003 system and need to script the deletion and creation of a profile in WebSphere Application Server. This requires me to call manageprofiles.bat twice, once to delete the existing profile and once to create a new profile.
In my batch file, I have the following:
cd "C:\Program Files\IBM\WebSphere\AppServer\bin"
manageprofiles.bat -delete -profileName AppSrv01
rmdir /s /q ..\profiles\AppSrv01
manageprofiles.bat -create -templatePath ..\profileTemplates\default -profileName AppSrv01 -profilePath ..\profiles\AppSrv01
The manageprofiles.bat file ends with:
set RC=%ERRORLEVEL%
@endlocal & exit /b %RC%
When there is an error deleting the profile in the second line of my batch file (which happens way too often), manageprofiles.bat spits out an error message and causes my batch file to terminate. I don't want this to happen since I will just delete the remainder of the profile in the next command. Reading the documentation for exit leads me to believe that the /b in the exit command in manageprofiles.bat should cause just manageprofiles.bat to terminate without affecting my bat file.
I don't want to touch the manageprofiles.bat file in any way since my changes could get reverted by an update down the road and break my script again. Is there anything I can do in my batch file to fix this?