Tiger Posted September 2, 2007 Share Posted September 2, 2007 Copy Files and Dirs from A to B expandcollapse popup#cs ---------------------------------------------------------------------------- AutoIt Version: 3.2.7.1 Author: Tiger Script Function: Template AutoIt script. #ce ---------------------------------------------------------------------------- ; Example Copy("C:\Test", "D:\Test") Func Copy($s_target, $e_target, $flag = 0) If Not StringInStr(StringRight($s_target, 1), "\") Then $s_target = $s_target & "\" If Not StringInStr(StringRight($e_target, 1), "\") Then $e_target = $e_target & "\" $ffff = FileFindFirstFile($s_target & "*") While 1 $ffnf = FileFindNextFile($ffff) If @error Then ExitLoop ; Dir If StringInStr(FileGetAttrib($s_target & $ffnf), "D") Then DirCopy($s_target & $ffnf, $e_target & $ffnf, $flag) ; File Else FileCopy($s_target & $ffnf, $e_target & $ffnf, $flag) EndIf WEnd ; Close Search FileClose($ffff) EndFunc ;==>CopyCopy.au3 My UDFs:- _RegEnumKey Link to comment Share on other sites More sharing options...
jvanegmond Posted September 2, 2007 Share Posted September 2, 2007 The same counts for copying. There is no need to copy each file manually, you can just copy many files with one function. github.com/jvanegmond Link to comment Share on other sites More sharing options...
MadBoy Posted September 2, 2007 Share Posted September 2, 2007 The same counts for copying. There is no need to copy each file manually, you can just copy many files with one function. I think if he does add error handling this might be usefull. For example some files can't be copied, or moved (if we speak about other post). And you wouldn't know which file went wrong. Also this could be used to add progress count to it. My little company: Evotec (PL version: Evotec) 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