svatvn Posted December 16, 2011 Share Posted December 16, 2011 Hi,I want to copy the whole content of a folder to another folder with AutoITThe code for batch would be like this:start /w XCOPY "%CD%\Copy\*.*" "C:\" /S /I /C /H /R /Y /Eso how is the code for AutoIT - without using xcopy - to copy the content?thanks Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted December 16, 2011 Moderators Share Posted December 16, 2011 svatvn,Look at DirCopy in the Help file. M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
rcmaehl Posted December 16, 2011 Share Posted December 16, 2011 (edited) You could just use _RunDOS() but here: FileCopy(@ScriptDir & "*.*", "C:", 8) Will do what you're asking. Edit: Fixed the command. Edited December 16, 2011 by rcmaehl My UDFs are generally for me. If they aren't updated for a while, it means I'm not using them myself. As soon as I start using them again, they'll get updated.My Projects WhyNotWin11Cisco Finesse, Github, IRC UDF, WindowEx UDF Link to comment Share on other sites More sharing options...
svatvn Posted December 16, 2011 Author Share Posted December 16, 2011 hi wow, thanks for the fast answer. @melba I don't know, how to copy the content of a folder (including files and subfolders) DirCopy only copy one single folder right? @rcmaehl: the code is what I need, unfortunately it only copies files, not folders.... so how can I tell the command, to copy folders too? (the complete content) Link to comment Share on other sites More sharing options...
rcmaehl Posted December 16, 2011 Share Posted December 16, 2011 (edited) hiwow, thanks for the fast answer.@melbaI don't know, how to copy the content of a folder (including files and subfolders)DirCopy only copy one single folder right?@rcmaehl: the code is what I need, unfortunately it only copies files, not folders....so how can I tell the command, to copy folders too? (the complete content)The 8 at the end of FileCopy should make it copy folders too. However, DirCopy can copy more than one folder. Edited December 16, 2011 by rcmaehl My UDFs are generally for me. If they aren't updated for a while, it means I'm not using them myself. As soon as I start using them again, they'll get updated.My Projects WhyNotWin11Cisco Finesse, Github, IRC UDF, WindowEx UDF Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted December 16, 2011 Moderators Share Posted December 16, 2011 svatvn,DirCopy copies a folder and all the subfolders and files within it. If you want to copy several separate folders without the lower level subfolders, then FileCopy is the way to go - although you will have to call it for each folder. M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
svatvn Posted December 16, 2011 Author Share Posted December 16, 2011 well, is it me orFileCopy(@ScriptDir & "*.*", "C:", 8)doesnt copy folders...?so, how can I tell DirCopy to copy the folders of an folder?start /w XCOPY "%CD%Copy*.*" "C:" /S /I /C /H /R /Y /Edoes exactly what I want (copy the complete content of a folder to another folder. I don' know why it is so complicated in AutoIT... Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted December 16, 2011 Moderators Share Posted December 16, 2011 svatvn,I don' know why it is so complicated in AutoITIt is not...... One more time:FileCopy copies the files of a folder - it does not copy subfolders, nor the files within them.DirCopy copies the whole tree - all files, subfolders, and the files within them.So to match XCopy you need DirCopy. Have you even looked at the Help file? On the first line of the DirCopy page you can see: "Similar to xcopy". Now go and try those 2 commands for yourself - as I did to check before I wrote the post above - and see how they differ. M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area 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