I have a FileName.exe file on the desktop. OK so far.
I have a script that runs and then opens another cmd prompt and runs the FileName.exe on the desktop. OK so far.
While the FileName.exe is running there is some user [key presses] interaction. OK so far.
The final interaction involves pressing any key which closes the cmd prompt window and opens a Notepad file. OK so far.
Whereby I am back in my original cmd prompt window. OK so far.
What I would like the code to do, and I just can't seem to fathom it out (I have tried many many variations), is when the FileName.exe has finished and the cmd prompt windows closes (after pressing any key to exit), I would like it to kill the Notepad file and show the message FileName.exe has completed successfully! and then show < Press ANY key to CONTINUE >. Whereby the rest of might script will continue to run!
Here is the code . . .
Code: Select all
@echo off
echo Running SFCFix . . .
echo.
start "" "%userprofile%\Desktop\FileName.exe" /secondary /minimized
echo ^< Press ANY key to CONTINUE ^> & Pause > NUL
taskkill /IM Notepad.exe > NUL
echo.
echo FileName.exe has completed successfully!
echo.
Thanks in advance.