cypher175 Posted March 10, 2010 Share Posted March 10, 2010 Is there anyway to Copy Multiple Files at Once..?? do these functions copy files one at a time or multiple files at once "FileCopy" & "DirCopy"..?? What I want to do is Search a Folder or Drive for all its Files + SubContents then copy multiple files from that Src to one Dest Folder at once.. But instead of mirroring the Folder or Drive i Just want to Copy all the files over into one single folder and append the Current Date + Time to each file copied over.. So in one Dest Folder I'll have all the Src files with the Time+Dates appended to each of them.. But my main concern is just copying multiple files at once like 10 files at a time.. How would I go about doing something like this..?? Link to comment Share on other sites More sharing options...
Xenobiologist Posted March 10, 2010 Share Posted March 10, 2010 You could try using the commandline (DOS) with Run or Shellexecute (maybe ...Wait) and start n instances of xcopy. Scripts & functions Organize Includes Let Scite organize the include files Yahtzee The game "Yahtzee" (Kniffel, DiceLion) LoginWrapper Secure scripts by adding a query (authentication) _RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...) Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc. MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times Link to comment Share on other sites More sharing options...
cypher175 Posted March 12, 2010 Author Share Posted March 12, 2010 is there any other way that doesn't involve using external executables like xcopy..?? Link to comment Share on other sites More sharing options...
Yashied Posted March 12, 2010 Share Posted March 12, 2010 (edited) If I understand you correctly, it should look something like this:#Include <File.au3> #Include <WinAPIEx.au3> _DirCopyEx(@WindowsDir, @ScriptDir & '\---JPG---', '*.jpg') Func _DirCopyEx($sSrc, $sDest, $sMask = '*') Local $FileList, $FileName, $Time, $Path, $Name, $Ext, $Count $FileList = _FileListToArray($sSrc, $sMask, 1) If Not @error Then For $i = 1 To $FileList[0] $Time = '[' & _WinAPI_GetDateFormat(0, 0, 0, 'dd-MMM-yy') & ' & ' & _WinAPI_GetTimeFormat(0, 0, 0, 'h-mm') & ']' $Name = StringRegExpReplace($FileList[$i], '\.[^.]*$', '') & ' ' & $Time $Ext = StringRegExpReplace($FileList[$i], '^.*\.', '') $Path = $sDest & '\' & $Name & '.' & $Ext $Count = 2 While FileExists($Path) $Path = $sDest & '\' & $Name & ' (' & $Count & ').' & $Ext $Count += 1 WEnd If Not FileCopy($sSrc & '\' & $FileList[$i], $Path, 8) Then Return 0 EndIf Next EndIf $FileList = _FileListToArray($sSrc, '*', 2) If Not @error Then For $i = 1 To $FileList[0] If Not _DirCopyEx($sSrc & '\' & $FileList[$i], $sDest, $sMask) Then Return 0 EndIf Next EndIf Return 1 EndFunc ;==>_DirCopyExWinAPIEx.au3 Edited March 12, 2010 by Yashied My UDFs: iKey | FTP Uploader | Battery Checker | Boot Manager | Font Viewer | UDF Keyword Manager | Run Dialog Replacement | USBProtect | 3D Axis | Calculator | Sleep | iSwitcher | TM | NetHelper | File Types Manager | Control Viewer | SynFolders | DLL Helper Animated Tray Icons UDF Library | Hotkeys UDF Library | Hotkeys Input Control UDF Library | Caret Shape UDF Library | Context Help UDF Library | Most Recently Used List UDF Library | Icons UDF Library | FTP UDF Library | Script Communications UDF Library | Color Chooser UDF Library | Color Picker Control UDF Library | IPHelper (Vista/7) UDF Library | WinAPI Extended UDF Library | WinAPIVhd UDF Library | Icon Chooser UDF Library | Copy UDF Library | Restart UDF Library | Event Log UDF Library | NotifyBox UDF Library | Pop-up Windows UDF Library | TVExplorer UDF Library | GuiHotKey UDF Library | GuiSysLink UDF Library | Package UDF Library | Skin UDF Library | AITray UDF Library | RDC UDF Library Appropriate path | Button text color | Gaussian random numbers | Header's styles (Vista/7) | ICON resource enumeration | Menu & INI | Tabbed string size | Tab's skin | Pop-up circular menu | Progress Bar without animation (Vista/7) | Registry export | Registry path jumping | Unique hardware ID | Windows alignment More... Link to comment Share on other sites More sharing options...
cypher175 Posted March 12, 2010 Author Share Posted March 12, 2010 does that code copy more than 1 file at time..?? Link to comment Share on other sites More sharing options...
Yashied Posted March 12, 2010 Share Posted March 12, 2010 (edited) No, it copies successively.EDIT:During one call of this function will copy all files from $sSrc folder to $sDest folder. You wanted this? Edited March 12, 2010 by Yashied My UDFs: iKey | FTP Uploader | Battery Checker | Boot Manager | Font Viewer | UDF Keyword Manager | Run Dialog Replacement | USBProtect | 3D Axis | Calculator | Sleep | iSwitcher | TM | NetHelper | File Types Manager | Control Viewer | SynFolders | DLL Helper Animated Tray Icons UDF Library | Hotkeys UDF Library | Hotkeys Input Control UDF Library | Caret Shape UDF Library | Context Help UDF Library | Most Recently Used List UDF Library | Icons UDF Library | FTP UDF Library | Script Communications UDF Library | Color Chooser UDF Library | Color Picker Control UDF Library | IPHelper (Vista/7) UDF Library | WinAPI Extended UDF Library | WinAPIVhd UDF Library | Icon Chooser UDF Library | Copy UDF Library | Restart UDF Library | Event Log UDF Library | NotifyBox UDF Library | Pop-up Windows UDF Library | TVExplorer UDF Library | GuiHotKey UDF Library | GuiSysLink UDF Library | Package UDF Library | Skin UDF Library | AITray UDF Library | RDC UDF Library Appropriate path | Button text color | Gaussian random numbers | Header's styles (Vista/7) | ICON resource enumeration | Menu & INI | Tabbed string size | Tab's skin | Pop-up circular menu | Progress Bar without animation (Vista/7) | Registry export | Registry path jumping | Unique hardware ID | Windows alignment More... Link to comment Share on other sites More sharing options...
JohnOne Posted March 12, 2010 Share Posted March 12, 2010 This seems like a "does autoit support multihreading" question. If that is the case, then the answer is no. AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
cypher175 Posted March 12, 2010 Author Share Posted March 12, 2010 copying multiple files at once instead of one at a time is multihreading..?? Link to comment Share on other sites More sharing options...
Yashied Posted March 12, 2010 Share Posted March 12, 2010 It's very stupid. You seriously believe that Windows copies all files from your folder at once? My UDFs: iKey | FTP Uploader | Battery Checker | Boot Manager | Font Viewer | UDF Keyword Manager | Run Dialog Replacement | USBProtect | 3D Axis | Calculator | Sleep | iSwitcher | TM | NetHelper | File Types Manager | Control Viewer | SynFolders | DLL Helper Animated Tray Icons UDF Library | Hotkeys UDF Library | Hotkeys Input Control UDF Library | Caret Shape UDF Library | Context Help UDF Library | Most Recently Used List UDF Library | Icons UDF Library | FTP UDF Library | Script Communications UDF Library | Color Chooser UDF Library | Color Picker Control UDF Library | IPHelper (Vista/7) UDF Library | WinAPI Extended UDF Library | WinAPIVhd UDF Library | Icon Chooser UDF Library | Copy UDF Library | Restart UDF Library | Event Log UDF Library | NotifyBox UDF Library | Pop-up Windows UDF Library | TVExplorer UDF Library | GuiHotKey UDF Library | GuiSysLink UDF Library | Package UDF Library | Skin UDF Library | AITray UDF Library | RDC UDF Library Appropriate path | Button text color | Gaussian random numbers | Header's styles (Vista/7) | ICON resource enumeration | Menu & INI | Tabbed string size | Tab's skin | Pop-up circular menu | Progress Bar without animation (Vista/7) | Registry export | Registry path jumping | Unique hardware ID | Windows alignment More... Link to comment Share on other sites More sharing options...
cypher175 Posted March 13, 2010 Author Share Posted March 13, 2010 I dont mean like in a magic split instant all yer files are copied.. I mean instead of copping one file after the other one at a time, copy 10 files at a time simultaneously..!!! Link to comment Share on other sites More sharing options...
Pain Posted March 13, 2010 Share Posted March 13, 2010 They are basically copied right after each other, unless you have several threads making it "appear" as they were copied simultaneously. Link to comment Share on other sites More sharing options...
Yashied Posted March 13, 2010 Share Posted March 13, 2010 (edited) I mean instead of copping one file after the other one at a time, copy 10 files at a time simultaneously..!!!This does not happen. You can verify this yourself by running to copy the folder in Windows. Moreover, the simultaneous copying a few files will be much slower, because the HDD can not simultaneously write multiple data streams. Edited March 13, 2010 by Yashied My UDFs: iKey | FTP Uploader | Battery Checker | Boot Manager | Font Viewer | UDF Keyword Manager | Run Dialog Replacement | USBProtect | 3D Axis | Calculator | Sleep | iSwitcher | TM | NetHelper | File Types Manager | Control Viewer | SynFolders | DLL Helper Animated Tray Icons UDF Library | Hotkeys UDF Library | Hotkeys Input Control UDF Library | Caret Shape UDF Library | Context Help UDF Library | Most Recently Used List UDF Library | Icons UDF Library | FTP UDF Library | Script Communications UDF Library | Color Chooser UDF Library | Color Picker Control UDF Library | IPHelper (Vista/7) UDF Library | WinAPI Extended UDF Library | WinAPIVhd UDF Library | Icon Chooser UDF Library | Copy UDF Library | Restart UDF Library | Event Log UDF Library | NotifyBox UDF Library | Pop-up Windows UDF Library | TVExplorer UDF Library | GuiHotKey UDF Library | GuiSysLink UDF Library | Package UDF Library | Skin UDF Library | AITray UDF Library | RDC UDF Library Appropriate path | Button text color | Gaussian random numbers | Header's styles (Vista/7) | ICON resource enumeration | Menu & INI | Tabbed string size | Tab's skin | Pop-up circular menu | Progress Bar without animation (Vista/7) | Registry export | Registry path jumping | Unique hardware ID | Windows alignment More... Link to comment Share on other sites More sharing options...
JohnOne Posted March 13, 2010 Share Posted March 13, 2010 copying multiple files at once instead of one at a time is multihreading..??Thats what I thought, I wont be surprised if I am wrong though. AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
Steveiwonder Posted March 13, 2010 Share Posted March 13, 2010 (edited) I would use something like... ;Your program.exe Local $FileToCopy[4] $FileToCopy[0] = "file1.txt" $FileToCopy[1] = "file2.txt" $FileToCopy[2] = "file3.txt" $FileToCopy[3] = "file4.txt" For $i = 0 To Ubound($FileToCopy)-1 Step +1 Run("doCopy.exe """ & $FileToCopy[$i] & """ """ & "C:\test\" & $FileToCopy[$i] & """") Next doCopy.exe ;cmdline[1] contains source ;cmdline[2] contains destination FileCopy($CmdLine[1], & $CmdLine[2]) This will work however attempting to do what you want will seriously slow down your computer due to the fact your hard disk is being over worked(if you do to many). Stick to using the normal method It works much better. Steveiwonder. Edited March 13, 2010 by Steveiwonder They call me MrRegExpMan 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