Could you not recompile your pause.exe as a DLL file to be imported/called by your app?
The "PAUSE" command is part of cmd.exe, like "copy" or "dir". In opposite e.g. "xcopy" is an external program "xcopy.exe" and if it would not fit my purpose, I could rewrite and replace it.
The 4os2 source code is available, so I could change it, but I hope that I can handle the problem generally with cmd.exe.
A possible solution would be to ask the user how to handle the cmd file and, as an option, to rewrite it and renaming the original to *.cmd-old and replacing the occurences of "pause" to "pause2" and writing a tiny program "pause2". Or executing a temporary cmd file copy. But I hope that there's a better solution.
It would be already helpful if someone can explain why cmd.exe "Pause" does not accept a VIO keystroke. I don't understand what happens here. You can see the behaviour by typing "PAUSE" in MeShell, then make the VIO window visible, press a key and normally the LED should turn to green and the command "Pause" has finally been executed and a new Prompt appears. But MeShell does not do so. The LED rests red, so the keystroke in the VIO window has not been reached cmd.exe.