There were three small bugs in my previous code, here is the bug-free code. Option Explicit On Error Resume Next If Wscript.Arguments.Count<>1 Then WScript.Quit(0) Dim WshShell,i,j,ini,fso,f,s,s_,p,m1,m2,t,inst(),pCheck,pNames() Dim objWMIService,objProcess,colProcess,ProgName,ProgFlags Set WshShell=WScript.CreateObject("WScript.Shell") Set fso=CreateObject("Scripting.FileSystemObject") Set objWMIService=GetObject("winmgmts:" _ &"{impersonationLevel=impersonate}!\\.\root\cimv2") ini=Left(WScript.ScriptFullName,Len(WScript.ScriptFullName)+_ InStrRev(WScript.ScriptName,".")-Len(WScript.ScriptName))&"INI" p=Left(WScript.ScriptFullName,Len(WScript.ScriptFullName)-_ Len(WScript.ScriptName)) ProgFlags="":pCheck=False If Not fso.fileexists(ini) Then Set WshShell=Nothing:WScript.Quit(0) Set f=fso.OpenTextFile(ini,1) s=VbCrLf&f.ReadAll&VbCrLf&VbCrLf f.Close t=VbCrLf&"["&UCase(Wscript.Arguments(0))&"]" m1=InStr(UCase(s),t)+Len(t) If m1=0 Then Set WshShell=Nothing:WScript.Quit(0) m2=InStr(m1+3,s,VbCrLf&"[") If m2=0 Then m2=Len(s) s=Mid(s,m1,m2-m1)&VbCrLf s_=Ucase(s) m1=InStr(s_,VbCrLf&"PROGRAM") If m1=0 Then Set WshShell=Nothing:WScript.Quit(0) m1=InStr(m1+3,s,"=")+1 If m1=0 Then Set WshShell=Nothing:WScript.Quit(0) m2=InStr(m1,s,VbCrLf) ProgName=Mid(s,m1,m2-m1) If Left(ProgName,2)="@\" Then ProgName=p&Right(ProgName,Len(ProgName)-2) If Not fso.fileexists(ProgName) Then Set WshShell=Nothing:WScript.Quit(0) Set fso=Nothing m1=InStr(s_,VbCrLf&"SWITCHES") If m1<>0 Then m1=InStr(m1+3,s,"=")+1 If m1<>0 Then m2=InStr(m1,s,VbCrLf) ProgFlags=" "&Mid(s,m1,m2-m1) End If End If m1=1:i=-2:m2=0 Do m2=InStr(m2+1,s_,VbCrLf&"PROCESSCHECK") If m2=0 Then m1=0 i=i+1 Loop While m1 If i<>-1 Then j=i:pCheck=True ReDim pNames(i) m1=1:m2=1 For i=0 To j m1=InStr(m1,s_,VbCrLf&"PROCESSCHECK") m1=InStr(m1+3,s,"=")+1 If m1=0 Then Set WshShell=Nothing:WScript.Quit(0) t=InStr(m1+3,s,VbCrLf)+1 pNames(i)=Mid(s,m1,t-m1-1) Next'i End If m1=1:i=-2:m2=0 Do m2=InStr(m2+1,s_,VbCrLf&"OPERATIONTITLE") If m2=0 Then m1=0 i=i+1 Loop While m1 m1=1:j=-2:m2=0 Do m2=InStr(m2+1,s_,VbCrLf&"OPERATIONKEYS") If m2=0 Then m1=0 j=j+1 Loop While m1 If i<0 OR i<>j Then Set WshShell=Nothing:WScript.Quit(0) ReDim inst(i,1) m1=1:m2=1 For i=0 To j m1=InStr(m1,s_,VbCrLf&"OPERATIONTITLE") m1=InStr(m1+3,s,"=")+1 If m1=0 Then Set WshShell=Nothing:WScript.Quit(0) t=InStr(m1+3,s,VbCrLf)+1 inst(i,0)=Mid(s,m1,t-m1-1) m2=InStr(m2,s_,VbCrLf&"OPERATIONKEYS") m2=InStr(m2+3,s,"=")+1 If m2=0 Then Set WshShell=Nothing:WScript.Quit(0) t=InStr(m2,s,VbCrLf)+1 inst(i,1)=Mid(s,m2,t-m2-1) Next'i j=0:s="":s_="" WshShell.Run(""""&ProgName&""""&ProgFlags) For i=0 To UBound(inst) If inst(i,1)="[!]" Then Set colProcess=Nothing Set colProcess=objWMIService.ExecQuery _ ("Select * from Win32_Process Where Name = """&inst(i,0)&"""") For Each objProcess in colProcess objProcess.Terminate() Next Else Do until WshShell.AppActivate(inst(i,0)) WScript.Sleep 300 If pCheck Then If CheckForProcess() Then j=0 Else j=j+1 If j=14 Then Set WshShell=Nothing:WScript.Quit(1) End If End If Loop WshShell.SendKeys inst(i,1) End If Next'i Set WshShell=Nothing WScript.Quit(1) Function CheckForProcess() CheckForProcess=False For Each t in pNames Set colProcess=Nothing Set colProcess=objWMIService.ExecQuery _ ("Select * from Win32_Process Where Name = """&t&"""") For Each objProcess in colProcess CheckForProcess=True Exit Function Next Next End Function Save as OEMINST.VBS [Winamp] Program =@\WINA295.EXE Switches =/S ProcessCheck01 =WINA295.EXE ProcessCheck02 =WINAMP.EXE OperationTitle01 =Winamp Setup: Settings OperationKeys01 ={TAB}{TAB}N{TAB} {UP} {UP}{UP}{UP} ~ OperationTitle02 =Winamp Setup: Winamp successfully installed OperationKeys02 =%{F4} Save as OEMINST.INI The ability to terminate processes has been added, syntax is: OperationTitle=notepad.exe OperationKeys=[!] That would be suitable for killing notepad if that's launched at the end of installation (keep in mind EVERY instance of notepad running will be ended). Commented source code and documentation will come next. Enjoy. Note: Some dialogues don't actually get focus when WshShell.AppActivate is run. To test any automated installation always alt-tab to give another application focus as soon as you've run oeminstaller. This is not an error in OEM Installer, but rather a limitation of WScript. If the automation fails then do this: [CloneDVD] Program =@\SetupCloneDVD2Slysoft.exe Switches =/S ProcessCheck =SetupCloneDVD2Slysoft.exe OperationTitle =CloneDVD2 Setup OperationKeys =N (OLD) For some reason WshShell.AppActivate("CloneDVD2 Setup") will return true, but not pass focus on to the dialogue. You can test this. [CloneDVD] Program =@\SetupCloneDVD2Slysoft.exe Switches =/S ProcessCheck =SetupCloneDVD2Slysoft.exe OperationTitle01 =CloneDVD2 Setup OperationKeys01 =%{TAB} OperationTitle02 =SetupCloneDVD2Slysoft.exe OperationKeys02 =[!] (NEW) This will cause OEM Installer to wait until the final dialogue is displayed, hit Alt-Tab (a non-invasive command, you can put whatever you like) - and then terminate the SetupCloneDVD2Slysoft.exe process.