I am trying to write a batch file that starts another batch file, waits for that batch file to complete its job, and then continue once that other batch file has exited. However, when I manually close the batch file launched by the first batch file, it comes up with a prompt saying:
^CTerminate batch job (Y/N)?
Is there a way to automatically select 'N', because it needs to delete some temporary files on exit.
Purpose/Premise of Script: To be able to remove a flash drive and lock the station (hence copying files to external source).
Summary of Script:
Solutions Tried:
START /WAIT +/I +/B
(Adding /I
or /B
did not produce anything useful)/C
and /K
switches after the START /WAIT program.bat +/C +/K
(had no affect)Well, you could use echo n | program.bat
to automatically respond n
to ^CTerminate batch job (Y/N)?
, but an easy way to fool this method is to hit and keep pressed [Ctrl]-C
.
There simply is no reliable way to disable the interruption of any program (much less a batch file). What stops the user from just closing the window?