 |
AutoHotkey Community Let's help each other out
|
| View previous topic :: View next topic |
| Author |
Message |
Candle
Joined: 19 Aug 2004 Posts: 334
|
Posted: Sat Aug 21, 2004 6:20 am Post subject: need a tune up |
|
|
I think I have this right but it no copy to other folder ?
Anyhelp with this if you have time .
Thank you .
| Code: | FileSelectFolder, OutputVar, , 3
if OutputVar =
MsgBox, The user didn't select a folder.
else
MsgBox, The user selected folder "%OutputVar%".
FileSelectFolder, inputVar, , 3
if OutputVar =
MsgBox, The user didn't select a folder.
else
MsgBox, The user selected folder "%inputVar%".
FileCopyDir, %OutputVar%, %inputVar% |
|
|
| Back to top |
|
 |
Beastmaster
Joined: 15 Apr 2004 Posts: 182
|
Posted: Sat Aug 21, 2004 7:33 am Post subject: |
|
|
Thx to BoBo.
My statement here was wrong and I've decided to delete it, as I don't want to confuse anyone out there with an incorrect advise 
Last edited by Beastmaster on Sat Aug 21, 2004 8:20 am; edited 1 time in total |
|
| Back to top |
|
 |
Candle
Joined: 19 Aug 2004 Posts: 334
|
Posted: Sat Aug 21, 2004 7:38 am Post subject: |
|
|
| I changed it but it still won't copy the folder ? |
|
| Back to top |
|
 |
BoBo Guest
|
Posted: Sat Aug 21, 2004 8:14 am Post subject: |
|
|
Beastmaster seems to be wrong --> FileCopyDir, Source, Dest [, Flag]
Both parameters are literals by default and therefore have to be declared if should contain a variable  |
|
| Back to top |
|
 |
Candle
Joined: 19 Aug 2004 Posts: 334
|
Posted: Sat Aug 21, 2004 8:17 am Post subject: |
|
|
| Well the way I had it first didn't copy and now it does not copy so I'm not sure what to do with it ? |
|
| Back to top |
|
 |
Chris Site Admin
Joined: 02 Mar 2004 Posts: 10467
|
Posted: Sat Aug 21, 2004 12:00 pm Post subject: |
|
|
Here is a working example:
| Code: | FileSelectFolder, SourceFolder, , 3, Select the folder to copy
if SourceFolder =
return
; Otherwise, continue.
FileSelectFolder, TargetFolder, , 3, Select the folder IN WHICH to create the duplicate folder.
if TargetFolder =
return
; Otherwise, continue.
MsgBox, 4, , A copy of the folder "%SourceFolder%" will be put into "%TargetFolder%". Continue?
IfMsgBox, No
return
SplitPath, SourceFolder, SourceFolderName ; Extract only the folder name from its full path.
FileCopyDir, %SourceFolder%, %TargetFolder%\%SourceFolderName%
if ErrorLevel <> 0
MsgBox The folder could not be copied, perhaps because a folder of that name already exists in "%TargetFolder%".
return |
I've also updated the documentation with this: "Since the operation will recursively copy a folder along with all its subfolders and files, the result of copying a folder to a destination somewhere inside itself is undefined. To work around this, first copy it to a destination outside itself, then use FileMoveDir to move that copy to the desired location." |
|
| Back to top |
|
 |
Candle
Joined: 19 Aug 2004 Posts: 334
|
Posted: Sat Aug 21, 2004 7:30 pm Post subject: |
|
|
| Thank you that work great . |
|
| Back to top |
|
 |
|
|
You can post new topics in this forum You can reply to topics in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|