vickerps Posted March 10, 2004 Share Posted March 10, 2004 Hi guys this is a very noob question Filecopy Return value is 0 or 1 1=success 0=failure If the filecopy fails i want to know about it so how query the return value Link to comment Share on other sites More sharing options...
vickerps Posted March 10, 2004 Author Share Posted March 10, 2004 Cheers I have lots of files to copy to different places and I don't really want to create lot of variables and then have to write a if for each one to see if it has failed. is there any clever people out there who can suggest a better way. I was thinking about calling a function but the some of the filecopy's are contained in other functions already which will make it calling a function from a function which sounds messy. Link to comment Share on other sites More sharing options...
Administrators Jon Posted March 10, 2004 Administrators Share Posted March 10, 2004 The copy returns 1 so do: $result = 0 $result = $result + FileCopy(....) Do this for as many files as you want, and then when you want to test if they have all been successful compare $result to the number of copies. For example if you do 10 copies and $result is 10 you know that all have succeeded. If $result does not equal 10 then one or more have failed. Deployment Blog: https://www.autoitconsulting.com/site/blog/ SCCM SDK Programming: https://www.autoitconsulting.com/site/sccm-sdk/ Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now