4Bravo Posted November 7, 2012 Share Posted November 7, 2012 (edited) I've double checked the arrays, and used the function manually, with out the array. But I don't know where to plug this FileCopy in a For and Next. Every time I execute it I get an oddly named file in the directory the script was launched from. Blah... I realised I forgot [$i] after the array #include <Array.au3> #include <RecFileListToArray.au3> AutoItSetOption("TrayIconDebug",True) $sPath = "D:Temp" $movFILE = "D:mov.veg" $flaDIR = _RecFileListToArray($sPath, "*.fla", 1, 1, 0, 2) $justFILE = _RecFileListToArray($sPath, "*.fla", 1, 1, 0, 0) For $i = 1 To $justFILE[0] $justFILE[$i] = StringTrimRight($justFILE[$i], 4) next For $i = 1 To $flaDIR[0] $flaDIR[$i] = StringReplace($flaDIR[$i], $justFILE[$i] & ".fla", "") FileCopy($movFILE, $flaDIR[$i]) next Edited November 7, 2012 by 4Bravo Link to comment Share on other sites More sharing options...
Varian Posted November 7, 2012 Share Posted November 7, 2012 It appears as though you are searching for each directory that contains an "fla" file and copying "mov.reg" to that directory. You can try this as it is little less code: #include <Array.au3> #include <RecFileListToArray.au3> AutoItSetOption("TrayIconDebug", True) Local $sPath, $movFILE, $DestDir $sPath = "D:Temp" $movFILE = "D:mov.veg" $flaDIR = _RecFileListToArray($sPath, "*.fla", 1, 1, 0, 2) For $i = 1 To $flaDIR[0] $DestDir = StringRegExpReplace($flaDIR[$i], '[^]+$', '') FileCopy($movFILE, $DestDir) Next 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