Grof 3 Posted June 27, 2019 (edited) In the executable folder are two subfolder, 1 and 2. 1 contain some stuff, 2 is empty. I have written: Local $PORTABLEDIR1 = "1" Local $PORTABLEDIR2 = "2" FileCopy($PORTABLEDIR1 & "\*.*", $PORTABLEDIR2) Not works (does't copy). I have tryed also Local $PORTABLEDIR1 = @HomePath & "\1" Local $PORTABLEDIR2 = @HomePath & "\2" Where is the mismatch? Edited June 27, 2019 by Grof Share this post Link to post Share on other sites
Grof 3 Posted June 27, 2019 (edited) Sorry. I have found the solution. Why if I have a folder in exe path, I cannot use @HomePath to refeer it? Edited June 27, 2019 by Grof Share this post Link to post Share on other sites
Sidley 18 Posted June 27, 2019 (edited) Why not use DirCopy? @ScriptDir will refer to the directory the script is called from. Edited June 27, 2019 by Sidley Extra info 1 Earthshine reacted to this Share this post Link to post Share on other sites
TheXman 432 Posted June 27, 2019 21 minutes ago, Grof said: Why if I have a folder in exe path, I cannot use @HomePath to refeer it? The short answer is because it would be the wrong macro. A longer answer is because @HomePath resolves to the same location as the %HOMEPATH% environment variable. So unless your script/exe is in the %HOMEPATH% folder, using that macro is WRONG. If you would have spent a little more time in the Help file as others have suggested, you may have come across another macro named @ScriptDir which, as it is named, refers to the folder in which the script/exe is running. 1 Earthshine reacted to this About TheXman | CryptoNG UDF - Cryptography API: Next Gen | HttpApi UDF - HTTP Server API | jq UDF - Powerful and Flexible JSON Processor If you want better answers, learn how to ask better questions or read How to Ask Questions in a Technical Forum. Share this post Link to post Share on other sites
Skysnake 78 Posted June 27, 2019 @TheXman is right. Check out the differences between @scriptdir @workingdir And the Macro Reference in the Help File Skysnake Why is the snake in the sky? Share this post Link to post Share on other sites
Grof 3 Posted June 27, 2019 "Why not use DirCopy? ". I'm translating a NSIS algorithm, and because I'm learning, I'm trying to be closest to the original. " If you would have spent a little more time in the Help file". I have spent many time in the help file, but many things I haven't understood, many I' have forgotten, and don't forget I'm here only from 48 hours! Anyway I've translated ALL the code except the registry routine. Few minutes and I'll begin to write post about it! (And this wil be very hard, so get ready!!!). Share this post Link to post Share on other sites
Skysnake 78 Posted June 27, 2019 DirCopy is a command. It tells AutoIt to do something. @WorkingDir is a macro, a shortcut to tell AutoIt where to get the folder These are not opposites, they are complementary. ; DirCopy ( "source dir", "dest dir" [, flag = 0] ) Consolewrite("@scriptdir "& @scriptdir&@CRLF) Consolewrite("@workingdir "& @workingdir&@CRLF) DirCopy(@scriptdir &"\*", @workingdir, 0) ; note that if the two macros have the same value, then nothing will happen :) Skysnake Why is the snake in the sky? Share this post Link to post Share on other sites