Hi
How can I copy all files from on e directory into another?
I'm using FileCopy statement but in the loop my pointer to files in first dir does not move. Looks like I'm copying the same file over and over
Thanks
Use something like this:
this code here counts all dirs, but you can adapt it to look for archives . add a filecopy command everytime you do the `loop and it should be ok-
if this is not enough for you or need further help:
email me at antoniolondon@yahoo.com good lukkk
'establish search pattern similñar constants exists for
'vbAchive, vbHidden, vbSystem, etc. this one seek directories.:
retornoDir = Dir(srcPath & "*.*", vbDirectory)
'while dir is not empty
Do While retornoDir <> ""
'skip these ( as in msdos ) as theyre not true dirs.
If retornoDir <> "." And retornoDir <> ".." Then
If (GetAttr(srcPath & retornoDir) And vbDirectory) = vbDirectory Then
count= count+ 1
End If
End If
retornoDir = Dir 'search next with same pattern as above
Loop
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.