AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

need a tune up

 
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Ask for Help
View previous topic :: View next topic  
Author Message
Candle



Joined: 19 Aug 2004
Posts: 334

PostPosted: Sat Aug 21, 2004 6:20 am    Post subject: need a tune up Reply with quote

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
View user's profile Send private message
Beastmaster



Joined: 15 Apr 2004
Posts: 182

PostPosted: Sat Aug 21, 2004 7:33 am    Post subject: Reply with quote

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 Embarassed


Last edited by Beastmaster on Sat Aug 21, 2004 8:20 am; edited 1 time in total
Back to top
View user's profile Send private message
Candle



Joined: 19 Aug 2004
Posts: 334

PostPosted: Sat Aug 21, 2004 7:38 am    Post subject: Reply with quote

I changed it but it still won't copy the folder ?
Back to top
View user's profile Send private message
BoBo
Guest





PostPosted: Sat Aug 21, 2004 8:14 am    Post subject: Reply with quote

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 Wink
Back to top
Candle



Joined: 19 Aug 2004
Posts: 334

PostPosted: Sat Aug 21, 2004 8:17 am    Post subject: Reply with quote

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
View user's profile Send private message
Chris
Site Admin


Joined: 02 Mar 2004
Posts: 10467

PostPosted: Sat Aug 21, 2004 12:00 pm    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail
Candle



Joined: 19 Aug 2004
Posts: 334

PostPosted: Sat Aug 21, 2004 7:30 pm    Post subject: Reply with quote

Thank you that work great .
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Ask for Help All times are GMT
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group