rafu5418 Posted November 17, 2008 Posted November 17, 2008 Hi every one, i am really new on this script programming.. . Actually i work in a office where my office colleagues give me some types of files like example: 'rafu7868.doc', 'lima23456.doc', 'pilu7862.doc'.. etc.. in a folder. so, i just want to collect rafu documents not the others... each documents save the name and create random numbers at the end of the name... i want a script that will collect the rafu documents and past it in the My Documents folder... how i can do it.... please help me guys... thank you rafu
Pain Posted November 17, 2008 Posted November 17, 2008 (edited) #Include <File.au3> #Include <Array.au3> $FileList=_FileListToArray(@DesktopDir); change dir If @Error=1 Then MsgBox (0,"","No Files\Folders Found.") Exit EndIf For $file In $FileList If StringInStr($file, "test") Then ;ConsoleWrite(@desktopdir & "\" & $file &@CR) FileCopy(@desktopdir & "\" & $file, @MyDocumentsDir) EndIf Next Edited November 17, 2008 by Pain
torels Posted November 17, 2008 Posted November 17, 2008 (edited) go an look for FileFindFirst/FileFindNext functions, and just in case StringLeft and Random() in the helpfilecheersEdit: Pain beated me by a few seconds Edited November 17, 2008 by torels Some Projects:[list][*]ZIP UDF using no external files[*]iPod Music Transfer [*]iTunes UDF - fully integrate iTunes with au3[*]iTunes info (taskbar player hover)[*]Instant Run - run scripts without saving them before :)[*]Get Tube - YouTube Downloader[*]Lyric Finder 2 - Find Lyrics to any of your song[*]DeskBox - A Desktop Extension Tool[/list]indifference will ruin the world, but in the end... WHO CARES :P---------------http://torels.altervista.org
rafu5418 Posted November 17, 2008 Author Posted November 17, 2008 (edited) #Include <File.au3> #Include <Array.au3> $FileList=_FileListToArray(@DesktopDir); change dir If @Error=1 Then MsgBox (0,"","No Files\Folders Found.") Exit EndIf For $file In $FileList If StringInStr($file, "test") Then ;ConsoleWrite(@desktopdir & "\" & $file &@CR) FileCopy(@desktopdir & "\" & $file, @MyDocumentsDir) EndIf Next thank you.... i got it... and i changes the Dir and it works.... it's copy automatically... thank you [Pain] and [torels] Edited November 17, 2008 by rafu5418
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