teeboi Posted April 28, 2011 Posted April 28, 2011 I need a command to copy the folder & a file from the directory that i am working in over to like "c:\temp" what should be the command for this? Can i just say copy whatever in this folder(current folder i am in) to c:\temp? Please advise
kaotkbliss Posted April 28, 2011 Posted April 28, 2011 FileCopy will copy files. However, getting the directory if it's not the same every time and not a standard location may be a little more difficult. Check out the Macros for Directory and AutoIt related Macros in the help file to see if any of those will help. 010101000110100001101001011100110010000001101001011100110010000 001101101011110010010000001110011011010010110011100100001 My Android cat and mouse gamehttps://play.google.com/store/apps/details?id=com.KaosVisions.WhiskersNSqueek We're gonna need another Timmy!
sahsanu Posted April 28, 2011 Posted April 28, 2011 Can i just say copy whatever in this folder(current folder i am in) to c:\temp? Please advise I'm bored so take below script just as an example. It will copy every file/directory (but script) in the folder to temp dir located in the same folder. #include <file.au3> $source = @ScriptDir & "\" $directoryname = "temp" $destination = @ScriptDir & "\" & $directoryname & "\" $afilelist = _FileListToArray(@ScriptDir,"*",1) $adirectoryList = _FileListToArray(@ScriptDir,"*",2) If IsArray($afilelist) Then For $i = 1 To $afilelist[0] If $afilelist[$i] <> @ScriptName Then FileCopy($source & $afilelist[$i],$destination & $afilelist[$i],9) Next EndIf If IsArray($adirectoryList) Then For $i = 1 To $adirectoryList[0] If $adirectoryList[$i] <> $directoryname Then DirCopy($source & $adirectoryList[$i],$destination & $adirectoryList[$i]) Next EndIf
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