At times one may want to automate the sp_ctrl commands in Windows or NT. Since there are multiple ways to script in Windows, prescribing the answer is beyond the scope of this solution. However, the template described here may provide some insights into running such commands as script.
The sp_ctrl commands can be run as a script in Unix. It is also possible to run them as script in Windows or NT environment with the help of VBScript. The following template is provided which is from shell script in Unix and its equivalent (counterpart) can be inferred in VBScript. The template runs a "show compare" via OS prompt and sends the output to a file named output1.txt. Likewise other commands can be run and put in a loop if iterations are desired. Before invoking the script, it needs to have execute permissions and the environment needs to be set correctly. Here is the template:
./sp_ctrl <<++ > output1.txt