Had the same problem, stupid Oracle :-(
Couldn't get around it in the Oracle silent install batch script so I created a helper VBscript that waits for the Oracle installer process to exit before continuing. Also because a separate process is spawned I don't think there is a way to get the exit code to see if it succeeded or failed. There may be other things you can check to see if it succeed or failed after it finishing installing though.
Call the Oracle universal installer silently:
setup.exe -silent -nowelcome -force -responseFile """"C:\response\oracle11g.rsp""""
Then call the vbscript:
cscript.exe //nologo "C:\waitfororacle.vbs"
Here is the waitfororacle.vbs script:
Option Explicit
' Synopsys -
' This script is needed because of the way the Oracle Installer processes run.
' Setup.exe calls OUI.exe. The actual installation runs with java.exe, however
' java.exe does not run under the same process tree, so there is no way in the
' batch file to wait for the install to finish. To resolve this problem this
' script will look for the instance of java.exe that is running the Oracle install
' and waits for it to finish.
Dim oProcess
Dim oProcess2
Dim oWMI
Dim colProcesses
Dim strWQL
Set oWMI = GetObject("winmgmts:\\.\root\cimv2")
strWQL = "Select ExecutablePath from Win32_Process Where ExecutablePath Like '%OraInstall%'"
Do
Set colProcesses = oWMI.ExecQuery(strWQL)
For Each oProcess2 in colProcesses
Set oProcess = oProcess2
Next
Wscript.Sleep 1000
Loop While IsEmpty(oProcess)
Do
Set colProcesses = oWMI.ExecQuery(strWQL)
Wscript.Sleep 3000
Loop Until colProcesses.Count = 0