Is there a way to trap 'command not found'?

Jun 11, 2014
3
0
#1
We're in the process of trying to re-deploy a vast system of batch scripts which are used in our production department. These stem from ancient 4DOS and 4NT 2 environments onwards.

As part of this we've recently discovered at least two cases of a production script that was failing silently due to .EXEs being not where they should be.

Is there any global option to say if you're about to display "Unknown Command" do this instead?

Clearly one could do an 'exist' or 'which' test before each .EXE call (assuming 'which' could be leveraged in this way) but we're talking scrores of .BATs running hundreds of programs so that isn't practical to retrofit.

I guess the kind of thing I'm looking for is sort of like C++ exception handling in that you don't need to code for it explicitly it just 'happens' if something bad goes wrong.

Is there a feature in TCC 16 that will help this?