gfunk999 Posted September 17, 2007 Share Posted September 17, 2007 Hi All, How can we exclude files/directories with filecopy and dircopy? I know this has been brought up before, but the answer was to use xcopy to exclude files/directories. Is this still the case, or is there a way to accomplish this without having to use command utilities? FileCopy("C:\*.txt", "C:\backup\", 9) DirCopy("C:\", "E:\backup\", 1) Want to exclude: C:\program files C:\System Volume Information Also, if you noticed this command -> DirCopy("C:\", "E:\backup\", 1) does not copy the subdirectories, only the files in C:\. Am I doing something wrong? Thank you Gary Link to comment Share on other sites More sharing options...
John Posted September 17, 2007 Share Posted September 17, 2007 I would use FileFindFirstFile() FileFindNextFile() check it against my list of excludes and FileCopy() if it passes. You can still use DirCopy() just use If StringInStr(FileGetAttrib($File),"D") to see if it is a folder. Don't forget to FileClose() when you are done. Link to comment Share on other sites More sharing options...
gfunk999 Posted September 18, 2007 Author Share Posted September 18, 2007 Thanks for the quick reply John, I understand how to use FileFindFirstFile() & FileFindNextFile(); however, how do I use the exclusion list? Could you please post a small sample? I would use FileFindFirstFile() FileFindNextFile() check it against my list of excludes and FileCopy() if it passes. You can still use DirCopy() just use If StringInStr(FileGetAttrib($File),"D") to see if it is a folder. Don't forget to FileClose() when you are done. 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