Hi
Having an issue with getting CF_RESULT to work; so would appreciate any advice!
The following script works perfectly and copies the database. It
is running as domain admin account. However, it returns a CF_RESULT value of FALSE?
//Set IGNORESPACES to 1 to force script interpreter to ignore spaces.
//If using IGNORESPACES quote strings in {" ... "}
//Let>IGNORESPACES=1
//Script to take a copy of the database and put it on the SHARE for the RECOVERY team to access
Let>filename=\\vrbhimagetest\c$\Recovery Databases\dbRecovery.mdb
Let>newfilename=\\vrbhimagetest\c$\Recovery Databases\Users\SuperUsers\dbRecovery.mdb
Let>CF_OVERWRITE=1
CopyFile>%filename%,%newfilename%
Wait>4
MSG>CF_RESULT
GetDate>date
GetTime>time
'MSG>CF_RESULT
'IF>CF_RESULT=TRUE
'WriteLn>\\vrbhimagetest\c$\Recovery Databases\RecoveryDatabaseReplication.txt,result,%date% %time% - Database copied to SuperUserShare
'Else
' WriteLn>\\vrbhimagetest\c$\Recovery Databases\RecoveryDatabaseReplication.txt,result,%date% %time% - Database NOT COPIED to SuperUserShare
'EndIF
CF_RESULT issue
Moderators: JRL, Dorian (MJT support)
I also get a FALSE value for CF_RESULT even though the file copied OK. I am using MS v13.1.2 with Win 7 x64.
Code: Select all
let>CF_OVERWRITE=1
copyfile>C:\test.txt,G:\test.txt
mdl>CF_RESULT
exit>0
- Marcus Tettmar
- Site Admin
- Posts: 7395
- Joined: Thu Sep 19, 2002 3:00 pm
- Location: Dorset, UK
- Contact:
Doh! Looks like we've got things arse-about (in the help file, or software whichever way you look at it)
CF_RESULT gets its value from the operations "fAnyOperationsAborted" value.
So FALSE means it did NOT abort/cancel.
TRUE doesn't necessarily mean it was successful though. It just means the operation wasn't aborted or cancelled.
So look also at CF_RESULT_CODE which gives you any error code or zero if successful.
See the Windows docs for the function this is derived from:
http://msdn.microsoft.com/en-us/library ... s.85).aspx
So, if CF_RESULT is FALSE (it didn't abort/wasn't cancelled) and CF_RESULT_CODE is zero, things should be fine.
Now, the question is whether we update the help file or reverse the result of CF_RESULT. Given its name it makes sense it should return TRUE if NOT aborted. But that could be awkward for backward compat. reasons (although this facility hasn't existed long).
CF_RESULT gets its value from the operations "fAnyOperationsAborted" value.
So FALSE means it did NOT abort/cancel.
TRUE doesn't necessarily mean it was successful though. It just means the operation wasn't aborted or cancelled.
So look also at CF_RESULT_CODE which gives you any error code or zero if successful.
See the Windows docs for the function this is derived from:
http://msdn.microsoft.com/en-us/library ... s.85).aspx
So, if CF_RESULT is FALSE (it didn't abort/wasn't cancelled) and CF_RESULT_CODE is zero, things should be fine.
Now, the question is whether we update the help file or reverse the result of CF_RESULT. Given its name it makes sense it should return TRUE if NOT aborted. But that could be awkward for backward compat. reasons (although this facility hasn't existed long).
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?
Perfect. Thank you!!
thank you. that works a treat
- Marcus Tettmar
- Site Admin
- Posts: 7395
- Joined: Thu Sep 19, 2002 3:00 pm
- Location: Dorset, UK
- Contact:
It turns out this got accidentally reversed in the last build. It has been fixed in 13.1.03.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?