Kingpix Posted April 2, 2013 Share Posted April 2, 2013 (edited) Hello everyone! I'm writing an installer for my application that does a backup at a certain point. I'm writing AutoIT code since 3 years, and I really can't figure out why this line doesn't work. DirCopy(@ScriptDir, @ScriptDir & "\MWBackup", 1) I feel REALLY stupid, that's so simple! :S For some reason it creates the Directory but it doesn't copy files in it. Can you help me please? It works as intended with ANY other source folder. Edited April 2, 2013 by Kingpix Link to comment Share on other sites More sharing options...
KaFu Posted April 2, 2013 Share Posted April 2, 2013 I guess the target directory is created first and then the function tries to copy that into itself... #include <File.au3> Local $s_TempDir = _TempFile(@TempDir, "~", "", 7) DirCopy(@ScriptDir, $s_TempDir & "\", 1) DirRemove($s_TempDir & "\MWBackup\", 1) ; to avoid recursion during backup (taking a backup of the old backup) DirCopy($s_TempDir & "\", @ScriptDir & "\MWBackup\", 1) DirRemove($s_TempDir, 1) OS: Win10-22H2 - 64bit - German, AutoIt Version: 3.3.16.1, AutoIt Editor: SciTE, Website: https://funk.eu AMT - Auto-Movie-Thumbnailer (2024-Oct-13) BIC - Batch-Image-Cropper (2023-Apr-01) COP - Color Picker (2009-May-21) DCS - Dynamic Cursor Selector (2024-Oct-13) HMW - Hide my Windows (2024-Oct-19) HRC - HotKey Resolution Changer (2012-May-16) ICU - Icon Configuration Utility (2018-Sep-16) SMF - Search my Files (2024-Oct-20) - THE file info and duplicates search tool SSD - Set Sound Device (2017-Sep-16) Link to comment Share on other sites More sharing options...
Kingpix Posted April 2, 2013 Author Share Posted April 2, 2013 Thanks for the input, but I realized there is another problem. The @ScriptDir macro returns "E:", which is the root of the E HDD. And that's correct, but after doing some research I found out that DirCopy doesn't work with HDD roots. Link to comment Share on other sites More sharing options...
FireFox Posted April 2, 2013 Share Posted April 2, 2013 (edited) Even though, it seems weird to copy something inside itself. Edit: If this last does not work you can do a recursive copy, there may be some examples on the forum (e.g: _RecFileListToArray combined with FileCopy) . Br, FireFox. Edited April 2, 2013 by FireFox 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