Nynjardin Posted May 11, 2016 Posted May 11, 2016 Hi there, I perform a DirCopy and nothing happen Here my code: Quote DirCopy("Data", @MyDocumentsDir, $FC_OVERWRITE) I Use windows 10, and that not work even I start the .exe in admin mode... Data folder is in the same folder as the AutoIt executable. If the Data folder is already present in Documents, that change nothing... If I copy/paste the folder manually, all work fine For some test, I do this: Quote Run("7za.exe x -y ""DataDocs.7z"" -o" & @MyDocumentsDir) And that not work too! I got an error in 7za who say "Unsuported method" but I found nothing to help for the 7z case... and in my destination folder, I only have files with 0Ko. All files and subfolders are present, but all files are empty! If you have any idea... Thanks a lot!
Nynjardin Posted May 11, 2016 Author Posted May 11, 2016 If I do that: Quote $err = DirCopy("Data", @MyDocumentsDir, $FC_OVERWRITE) msgbox(0,"er",$err) I got error "o"
orbs Posted May 11, 2016 Posted May 11, 2016 (edited) @Nynjardin, welcome to AutoIt and to the forum! first, your command means to copy the content of "Data" into your Documents folder, not the "Data" folder itself (with its contents). this is a bit confusing, i admit; you'll need to get used to that. you need to create the target folder first. there is no permissions issue. second, assuming the script dir is your current working directory is not reliable. make yourself a general practice, to provide the absolute paths when handling files. this is actually easier than you think. third, the return value of DirCopy is not the error status - it's quite the opposite, that is 1=success and 0=failure. look at the help file. finally, when posting code to the forum, use the code tags (the < > toolbar icon), like this: #include <FileConstants.au3> Global $sSubDir = '\dummy' DirCreate(@MyDocumentsDir & $sSubDir) $iResult = DirCopy(@ScriptDir & $sSubDir, @MyDocumentsDir & $sSubDir, $FC_OVERWRITE) ConsoleWrite('DirCopy result (1=success,0=failure) = ' & $iResult & @CRLF) Edited May 11, 2016 by orbs Signature - my forum contributions: Spoiler UDF: LFN - support for long file names (over 260 characters) InputImpose - impose valid characters in an input control TimeConvert - convert UTC to/from local time and/or reformat the string representation AMF - accept multiple files from Windows Explorer context menu DateDuration - literal description of the difference between given dates WinPose - simultaneous fluent move and resize Apps: Touch - set the "modified" timestamp of a file to current time Show For Files - tray menu to show/hide files extensions, hidden & system files, and selection checkboxes SPDiff - Single-Pane Text Diff Magic Math - a math puzzle Demos: Title Bar Menu - click the window title to pop-up a menu
Nynjardin Posted May 11, 2016 Author Posted May 11, 2016 Hi orbs, Thanks for your answer! It's correct, all my data files was directly in Documents folder (with a lot of other files, so, I don't see it at first sight) I follow your advise now, thank you
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