anybastard 0 Posted October 13, 2010 Hi guys , i need to save files from folder with variable name . For example: .from c:\mydirectory\myfolder_Tom\*.* to c:\windows\destination folderthe problem is folder name (myfolder_Tom) , becouse i can have same folder but with different name from c:\mydirectory\myfolder_Jerry\*.* to c:\windows\destination folderMy question is , could i make a little script to copy all in this way ?from c:\mydirectory\myfolder_*\*.* to c:\windows\destination folderPlease , help me with link , code or other suggestion Thank so much for your collaboration Regards Anyb Share this post Link to post Share on other sites
JohnOne 1,603 Posted October 13, 2010 Heres a little start, that might help you begin.Global $aUsers[2] = ["myfolder_Tom", "myfolder_Jerry"] ; Array of user folders _MyCopyFunction($aUsers) Func _MyCopyFunction($aNames) Local $sPath = "c:\mydirectory\" ; Your path For $i = 0 To UBound($aNames) -1 ; 0 to amount of user folders in array _DoSomethingWith($sPath & $aNames[$i]) ; process your folder Next EndFunc Func _DoSomethingWith($sUserpath) ;code EndFunc AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Share this post Link to post Share on other sites
PsaltyDS 39 Posted October 13, 2010 Another way, using a wildcard to search for the folders: #include <File.au3> $sSrc = "c:mydirectory" $sSearch = "myfolder_*" $sDest = "c:\windows\destination" $aDirs = _FileListToArray($sSrc, $sSearch, 2) ; 2 = Folders only For $n = 1 To $aDirs[0] DirCreate($sDest & "\" & $aDirs[$n]) DirCopy($sSrc & "\" & $aDirs[$n], $sDest & "\" & $aDirs[$n], 1) Next Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law Share this post Link to post Share on other sites
anybastard 0 Posted October 13, 2010 Hi guys , thanks for your prompt help Today morning i will try your solution and share with us my feedback Regards AnyB Share this post Link to post Share on other sites
anybastard 0 Posted October 14, 2010 Good morning guys .all work fine....thank for that !!and if possible last help how to rename this folder ( with variable name ) in to other name example from c:\windows\Myfolder x to c:\windows\dukex is the variable Thank so much AnyB Share this post Link to post Share on other sites