Considering the following:
from PySTAF import *
import sys
try:
handle = STAFHandle("MyTest")
request = 'COPY FILE "C:\Users\NET\2.jpg" TOFILE "C:\aa.jpg" TOMACHINE 192.168.1.139'
result = handle.submit('192.168.1.139', 'FS', request)
except STAFException, e:
print "Error registering with STAF, RC: %d" % e.rc
I can't find the way to copy the jpg file ("2.jpg") on the remote machine (192.168.1.139). From CMD I use the following:
STAF local FS COPY FILE "C:\Users\NET\2.jpg" TOFILE "C:\aa.jpg" TOMACHINE 192.168.1.139
and it's working but nothing happens when I run the script. The file is not copied on the remote machine. No errors are thrown. I use:
request = 'START SHELL COMMAND "net start Themes" wait returnstdout'
result = handle.submit('192.168.1.139', 'PROCESS', request)
to start a windows service and it's working.
This should work to COPY to C:\Temp dir of remote:
result.result will print the error in case there is any.