The SHELL command is similar to SPAWN, but it is hard-coded to look for a specific return value of 0 (if you provide arguments after the SHELL command).
It turns out that ROBOCOPY.exe returns 0 only if no files were copied. It returns 1 if at least one file was copied and so EViews assumed this was a problem (the garbage being displayed as the error message was it showing an uninitialized string). So you should use SPAWN instead so that it will ignore any exit codes.
Code: Select all
spawn robocopy C:\tvb\ztobedeleted\test1 C:\tvb\ztobedeleted\test2
If you wanted to make sure that robocopy actually copied at least one file, you could tell SPAWN to look for an exit code value of 1:
Code: Select all
spawn(exit=1) robocopy C:\tvb\ztobedeleted\test1 C:\tvb\ztobedeleted\test2
Steve