The advice is pretty clear:
* Use %COMSPEC% and not CMD or COMMAND
* Don't use %COMSPEC% unless you need it for redirection or internal commands
Using COMSPEC to run a standard command should be avoided, not because it causes problems, but because it adds an additional and unnecessary command to the mix.
One other thing that came up recently that required the use of COMSPEC - I have a Kix script that performs a test and outputs "running" or "" to indicate when a process is running (or not). I call it from a network monitoring system, specifying the command as "Kix32.exe ShowStat.Kix --C:commandname". The monitoring system tags ">%TMPDIR%\0321984093.txt" to the end of the command, assuming that all output will be collected. I kept getting an empty file as a result - I finally modified the script, changing the "$Result @CRLF" line to "Shell '%COMSPEC% Echo ' + $Result". This allowed the external output redirection to work, and my remote management console to use Kix scripts to check and resolve problems. Since it used a random number as the temp output file, there wasn't any other method available.
Glenn
_________________________
Actually I
am a Rocket Scientist!