Eambo 0 Posted August 12, 2011 Hi Everyone, I'm wondering what the best way to make a copy of a folder is. I want a prompt that asks a user if they want to make a backup, and should they hit yes it'll automate the process. So far I have this, but it doesn't want to work: runwait(@comspec & "xcopy /s/e/i" & $InstallPath & "," & $InstallPath2 & "\Backup2") But that just doesn't seem to want to work. Is there a built in method of doing this? If not, does anyone know what's wrong with the above? Thanks! :-) Share this post Link to post Share on other sites
GEOSoft 67 Posted August 12, 2011 See DirCopy() in the help file or try runwait(@comspec & " xcopy /s/e/i" & $InstallPath & "," & $InstallPath2 & "\Backup2") GeorgeQuestion about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.*** The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number.Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else."Old age and treachery will always overcome youth and skill!" Share this post Link to post Share on other sites
Eambo 0 Posted August 12, 2011 (edited) See DirCopy() in the help file or try runwait(@comspec & " xcopy /s/e/i" & $InstallPath & "," & $InstallPath2 & "\Backup2") Thanks very much. I tried DirCopy, however it didn't copy sub directories - was I possibly doing something wrong? Also your code looked much more promising, it launched a command prompt window...but it just sat there and didn't copy anything unfortunately :-( Thanks for trying to help, much appreciated! Edit: Aha! It looks like if the folder already exists, it will not copy the files. I had a DirCreate before it, thinking the directory needed to exist - removed this and it seems to be working! Thanks for pointing me in the right direction! :-) Edited August 13, 2011 by Eambo Share this post Link to post Share on other sites
GEOSoft 67 Posted August 13, 2011 glad you found the answer. The help file will do wonders. GeorgeQuestion about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.*** The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number.Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else."Old age and treachery will always overcome youth and skill!" Share this post Link to post Share on other sites