Why don't you have program A close as soon as it calls the batch file?
Your batch file could look something like this:
	Code:
	pause
cd d:\2ndprogramdirectory
call 2ndprogram.exe parameter
cd\1stprogramdirectory
1stprogram.exe
 The pause will force you to press any key before launching program B.  This will ensure program A has time to completely exit.  The Call command waits until the command on that line has completed before continuing with the batch file.  In this case, it would run program B and not continue until program B is finished, then it will run program A.  This should work for you.