Using system.util.execute on gateway to run command line applications

I’m trying to execute xcopy.exe on a gateway event script using the following code:

cmd = [‘c:/windows/syswow64/xcopy.exe’, ‘\\l2-video-1\images’, ‘e:\images\’, ‘/S’, ‘/D’, ‘/C’, ‘/Y’]

The code executes fine using the console but doesn’t work at all when executed from within a gateway event (tag change) script. I’ve put additional code in to trap the procedure so I know that it is executing on the gateway. I’ve also turned UAC off. Any other ideas?


The difference might be the user running the script. When you run the script out of the console, the Windows user is you, so everything works. But when the script runs under the gateway, it runs as the Windows service user.

Thanks mgross. I think you’re right. I’ve pursued doing the same operation using the and shutil libraries.