misterDee Posted July 8, 2010 Share Posted July 8, 2010 Hi, Ive got a script that copy files to a selected location, everthing works fine But when im want to copy (for example) a mail-file, it fails because its in use. How can i see witch file dont copy, in a log of msgbox @error commands works only on a folder, not specific... Thanks Link to comment Share on other sites More sharing options...
LurchMan Posted July 8, 2010 Share Posted July 8, 2010 This should work for you: $sSourcePath = "C:\" ;Must have trailing backslash $sDestPath = "C:\dest\" $hSearch = FileFindFirstFile ($sSourcePath & "*.*") ;Get search Handle While 1 $sFile = FileFindNextFile ($hSearch) ;Get file name If @error Then ExitLoop If Not FileExists ($sDestPath & $sFile) Then MsgBox (16, "Error", "The file " & $sFile & " was not copied.") ;Test if file is there EndIf WEnd FileClose ($hSearch) Dating a girl is just like writing software. Everything's going to work just fine in the testing lab (dating), but as soon as you have contract with a customer (marriage), then your program (life) is going to be facing new situations you never expected. You'll be forced to patch the code (admit you're wrong) and then the code (wife) will just end up all bloated and unmaintainable in the end. Link to comment Share on other sites More sharing options...
misterDee Posted July 8, 2010 Author Share Posted July 8, 2010 Thanks man just what i needed, works perfect! 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