gfunk999 0 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 Share this post Link to post Share on other sites
John 5 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. Share this post Link to post Share on other sites
gfunk999 0 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. Share this post Link to post Share on other sites