I'm looking for some internal information as to how the shell command operates. The following code snippet doesn't work (services.tmp isn't created), and the command works fine from the command line.

shell '%COMSPEC% /C net start > services.tmp'

I've seen that this works correctly for nearly all of the Windows XP systems in our enterprise, but is failing on a third (11K) of our Windows NT systems. Ultimately, I'm looking for a non-WMI way to determine whether or not a given service is running, and sending the output from net start to a file and then parsing it is the best thing I've found so far.

@ERROR ends up being set to 255 for the above command. @ERROR is 0 when I remove everything from the > to the target filename. Other commands seem to work, but I can't get their output since I can't seem to get redirection working.

I'm wondering if my problem is related to some configuration setting on the problem systems. Does anyone know which API call is being made by the shell command and what parameters are used in the call? COMSPEC is set correctly, and it doesn't matter if I hard-code in the full path to CMD.EXE. I'm using version 4.22 (latest) of KiXtart.