I detected this while testing the new instance start of UE too.
On Windows XP (and probable also Windows 2000/NT4) the Windows command interpreter
cmd.exe is used for executing a batch file. If a Windows 32-bit GUI application is executed within this batch file, the command processor always waits for the termination of this application and so the batch file does not continue after starting the GUI application. To start a 32-bit GUI application within a batch file without waiting for the termination the command
start must be used as I have already described. Use
start /? in a command prompt window for details about the start command.
That is a totally different default mechanism as on Windows 9x where the virtual DOS machine (command.com) by default never waits for the exit of the started Windows GUI application and the start command must be used if the execution of the batch file should be halted until the GUI application has terminated.
The Windows command interpreter
cmd.exe does by default not wait for the termination of a 32-bit GUI application if it is executed directly in an command prompt window and not within a batch file. This handling can be changed by disabling the command extensions either by the
cmd.exe option
/E:OFF for current call only or be setting the registry value of
EnableExtensions to
0 under
HKEY_CURRENT_USER\Software\Microsoft\Command Processor
or
HKEY_LOCAL_MACHINE\Software\Microsoft\Command Processor
deeptinker what you have seen and I too can be easily explained. If UE/UES is already running with
Multiple Instances=0 and you start again the EXE, the new instance checks the INI parameter, then it checks if an instance of itself is already running. If this is true, the second instance sends a message to the first instance that it should itself bring to foreground and then the second instance terminates itself. The Windows command interpreter recognizes the termination of this started task and continues.
Exactly the same happens when I start Opera. If no Opera instance is currently running, the batch file does not continue until Opera is closed. But if an Opera instance is already running, it gets the focus, opens the file/link or a blank page in a new tab and then the batch file continues because the second instance of Opera has terminated itself.
So to get my batch file working on Windows NT4, Windows 2000 and Windows XP without an open console window until the second instance of UE is closed, use it with the start command and simply disable the capture option and the
Show DOS Box option which is really not needed here.
And very helpful are
Filemon,
Regmon and
Process Explorer from
Sysinternals. Especially the tool
Process Explorer can help a lot because you can see which application has started another application. And when clicking with the right mouse button on a running application and choose properties, it can be even seen very interesting things like the whole command line parameters used on starting the selected application.