TWC Posted December 19, 2005 Share Posted December 19, 2005 Forgive me for a stupid question but I have tried and can't make it work. I want to run FileCopy("C:\test.txt","C:\testdir") and if this fails I want the script to stop and exit. THANX Link to comment Share on other sites More sharing options...
Valuater Posted December 19, 2005 Share Posted December 19, 2005 maybe $file = FileCopy("C:\test.txt","C:\testdir") if $file = 0 then exit 8) Link to comment Share on other sites More sharing options...
MrSpacely Posted December 19, 2005 Share Posted December 19, 2005 Forgive me for a stupid question but I have tried and can't make it work. I want to run FileCopy("C:\test.txt","C:\testdir") and if this fails I want the script to stop and exit. THANX if you check the manual for the function filecopy note the Return Value section Return Value Success: Returns 1. Failure: Returns 0. so this would work if FileCopy("C:\test.txt","C:\testdir") = 0 then exit Link to comment Share on other sites More sharing options...
MrSpacely Posted December 19, 2005 Share Posted December 19, 2005 If Not FileCopy("C:\test.txt","C:\testdir") Then ExitLar.arg same 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