Scripting: Batch Script May Misbehave Randomly
In batch scripting, complex tasks may require storing values in environment variables, and calling other batch files or subroutines.
In this situation the various scripts/routines may malfunction.
One problem to look for is environment veriable reuse.
For example, if a batch file stores values in an environment variable called TMP1 (say), and then calls a subroutine/batch which also stores values in a variable of that name, the original batch will exihibit hard-to-debug behaviour. One remedy for this is to use environment variables named for the routine/script they are in, eg. TMP_GetDate, TMP_FileSize etc