One of the possible solutions for launching old DOS programs (and not only them) and performing some additional actions is through scripts, the launch of which from the user's point of view will look the same as the launch of the program itself, only the script can also execute some concomitant action. For example, the author of the question needs to delete a number of files after the execution of the program and change the values of the parameters in one of the files.
Let's try to solve the problem using scripts.
Once upon a time I had an IBM PC 286 with an EGA monitor, 40MB hard 5-inch disk (that's right, and another 5 "drive for floppy disk drive) that MS-DOS 6.22 and Norton Commander 4.0 worked on. Since I still remember a little bit how to work with BAT-files , which, however, are very often and successfully used to this day:
rem Отключаем вывод на экран: @echo off rem Очищаем экран: cls rem Переходим в папку с программой: cd "C:\OLD_PRG\" rem Здесь можно выполнить запуск необходимых программ ДО запуска rem основной программы, например, загрузить русификатор. rem Если запустить его через команду start, то он запустится в отдельном окне. rem Пример: start keyrus.com rem Но нам русификация нужна в этой сессии, потому запускаем его так: keyrus.com rem Теперь запускаем нужную программу и ждем ее завершения: start /wait OldPrg.exe rem Программа завершилась, теперь можно удалить нужные файлы. rem В данном примере это временные файлы *.tmp del *.tmp rem Восстановим файл настроек, для этого просто удалим измененный файл в rem папке программы, а потом заменим эталонным из резервной копии, в rem качестве которой у нас выступает подпапка BAK, находящаяся тут: rem "C:\OLD_PRG\BAK", просто использую относительные пути: del config.cfg copy .\BAK\config.cfg config.cfg rem Всё, теперь можно подождать нажатия любой кнопки, а затем выйти из сессии pause exit
The script is very simple, is given as an example. In fact, there is much to do with batch files.
The only drawback is that if you create a shortcut to the file directly, then when you launch it, you will see a console window in which our BAT file is running. This is also decidable, because there are utilities that can execute a BAT file hiding the console window in which it runs.
You can also run scripts on PowerShell , but since by default there is a limit in the Windows policy to execute such scripts, I will not consider this option. If it is still very interesting, then it is better to issue it as a separate question.
You can also invoke scripts in other languages, such as JavaScript, or Visual Basic Script.
And, as an option, you can write your own simple wrapper around someone else's EXE, which can be run via Process.Start using WaitForExit . In particular, I myself do this to work with the old console archiver ARJ.
Another option for old DOS programs is, of course, DosBox .
Here, depending on the situation, you can use different approaches to solve the indicated issue of launching old programs in a modern environment.