EndFunc Posted May 16, 2007 Share Posted May 16, 2007 (edited) For some reason I can't get this to copy. It displays what it should look like in a message box as far as the path but just won't copy files. The files types are being read from an ini file into an array with StringSplit but can't it to copy any type matching that to the specified directory. $SFDestination = IniRead($ConfigFile, "ConfigSet", "SFLocation", "NotFound") $SearchType = IniRead($ConfigFile, "ConfigSet", "Search", "NotFound") $SearchFile = StringSplit($SearchType, "|") $sCheckPath = FileGetAttrib($SFDestination) If Not StringInStr($sCheckPath, "D") Then DirCreate($SFDestination) EndIf GUICtrlSetData($Console, "Scanning for specific file types." & @CRLF, 1) For $c = 1 To $SearchFile[0] GUICtrlSetData($Console, "Transferring " & $SearchFile[$c] & " files, please hold." & @CRLF & @CRLF, 1) FileCopy("C:\*" & $SearchFile[$c], $SFDestination, 9) Next Thanks Edit: yes I know the Dircreate part is kinda redundant when using the Filecopy 9 flag. Edited May 16, 2007 by EndFunc EndFuncAutoIt is the shiznit. I love it. Link to comment Share on other sites More sharing options...
MHz Posted May 16, 2007 Share Posted May 16, 2007 May work better with a backslash. FileCopy("C:\*" & $SearchFile[$c], $SFDestination & '\', 9) The 9 flag has the effect of wanting a backslash to work ok. Link to comment Share on other sites More sharing options...
EndFunc Posted May 17, 2007 Author Share Posted May 17, 2007 It still doesn't like that. It just zooms by. I even tried doing this. FileCopy("C:\*" & $SearchFile[$c], $SFDestination & "\*.*", 9) And still doesn't work. Hmm?? EndFuncAutoIt is the shiznit. I love it. Link to comment Share on other sites More sharing options...
MHz Posted May 17, 2007 Share Posted May 17, 2007 It may depend what is in your ini file perhaps. Test works ok for me with the below. FileChangeDir('c:\') $ConfigFile = 'config.ini' $SFDestination = IniRead($ConfigFile, "ConfigSet", "SFLocation", "NotFound") $SearchType = IniRead($ConfigFile, "ConfigSet", "Search", "NotFound") $SearchFile = StringSplit($SearchType, "|") $sCheckPath = FileGetAttrib($SFDestination) If Not StringInStr($sCheckPath, "D") Then DirCreate($SFDestination) EndIf ;~ GUICtrlSetData($Console, "Scanning for specific file types." & @CRLF, 1) For $c = 1 To $SearchFile[0] ;~ GUICtrlSetData($Console, "Transferring " & $SearchFile[$c] & " files, please hold." & @CRLF & @CRLF, 1) FileCopy("C:\*" & $SearchFile[$c], $SFDestination, 9) Next Ini file used. [ConfigSet] SFLocation=folder Search=.txt And I finished with "folder" with a txt file inside from c:\. Link to comment Share on other sites More sharing options...
EndFunc Posted May 17, 2007 Author Share Posted May 17, 2007 that's weird because I still can't get it to work. It just zips right by. is there a better way to do this maybe? EndFuncAutoIt is the shiznit. I love it. 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