How can I verify if the base system copied a .txt file to a remote workstation? (MICROSCADA SYS600 9.2)
Hi, how you doing? I hope you can help me.
I was testing with the following function:
@DESTINY = "\\DAGGMZ_WS2\SC" @ORIGIN = COPY_RP_DI:CCM @COPY_FILE = OPS_CALL("COPY 'ORIGIN' 'DESTINY'",0) #IF %COPY_FILE.ST <> 0 #THEN #SET COPY_RP_DI:TIU = 1 #ELSE #SET COPY_RP_DI:TIU = 0
But the ST attribute of the OPS_CALL function returns the value zero as if the copy was successful when it is not, because I have the workstation disconnected from the LAN.
The operating system of the workstation is windows 7.
I was testing with the following function:
@DESTINY = "\\DAGGMZ_WS2\SC" @ORIGIN = COPY_RP_DI:CCM @COPY_FILE = OPS_CALL("COPY 'ORIGIN' 'DESTINY'",0) #IF %COPY_FILE.ST <> 0 #THEN #SET COPY_RP_DI:TIU = 1 #ELSE #SET COPY_RP_DI:TIU = 0
But the ST attribute of the OPS_CALL function returns the value zero as if the copy was successful when it is not, because I have the workstation disconnected from the LAN.
The operating system of the workstation is windows 7.
Voted best answer
first I remembered you question ...
Second I remembered of a second command called "xcopy" and checked this at MSDN
Now the fun part, which is ancient history.
... and I needed some time to recall this feature.
your "copy" command you call, is a so called internal command,
which never returns a valid errorlevel. So the ST attribute will always be zero.
So use this
OPS_CALL("XCOPY 'ORIGIN' 'DESTINY'",0)
And here is the related page at MSDN
As a advice read the above link I gave you, if you want to use more OS commands
and look for "exitcode"
There are more pitfalls in this area.
Second I remembered of a second command called "xcopy" and checked this at MSDN
Now the fun part, which is ancient history.
... and I needed some time to recall this feature.
your "copy" command you call, is a so called internal command,
which never returns a valid errorlevel. So the ST attribute will always be zero.
So use this
OPS_CALL("XCOPY 'ORIGIN' 'DESTINY'",0)
And here is the related page at MSDN
As a advice read the above link I gave you, if you want to use more OS commands
and look for "exitcode"
There are more pitfalls in this area.
Add new comment