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 

Looking for a better way to rename a directory

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



Joined: 18 Jul 2008
Posts: 3
Location: USA

PostPosted: Fri Jul 18, 2008 3:18 pm    Post subject: Looking for a better way to rename a directory Reply with quote

Working on an audio automation function that includes generating an MP3 through audacity. The other thing I'm doing is storing the previous weeks raw audio (44.1 kHz, 16-bit) under a new audacity filename & sub-directory, in order to be able to go back a week or two if something is wrong w/ the MP3. For example, audio stored last week as audio.aup now becomes audio_NM1.aup, & its directory changes from audio_data to audio_NM1_data.

I'm using filecopy in a recursive manner to copy the directory into the new name & then deleting the previous directory name. All of this works fine, but the problem is that this directory of raw audio files (.au) is large, and copying them takes time.

I've seen suggestions for using renaming from an IE window, but wondered if anyone has a more straightforward manner of doing this. Any suggestions would be welcome. Thanks.
Back to top
View user's profile Send private message
jaco0646



Joined: 07 Oct 2006
Posts: 556
Location: MN, USA

PostPosted: Fri Jul 18, 2008 6:06 pm    Post subject: Reply with quote

If you only want to rename the files and don't want 2 copies, use FileMove instead of FileCopy.
_________________
http://autohotkey.net/~jaco0646/
Back to top
View user's profile Send private message Visit poster's website
KeyClick



Joined: 18 Jul 2008
Posts: 3
Location: USA

PostPosted: Sat Jul 19, 2008 1:51 am    Post subject: Reply with quote

Thanks, but I don't want to change the files in any manner, only the top level directory name.
Back to top
View user's profile Send private message
infogulch



Joined: 27 Mar 2008
Posts: 127
Location: KC, MO

PostPosted: Sat Jul 19, 2008 2:01 am    Post subject: Reply with quote

TFM wrote:
FileMoveDir:

Moves a folder along with all its sub-folders and files. It can also rename a folder.
...
Code:
FileMoveDir, C:\My Folder, C:\My Folder (renamed), 1

_________________
Back to top
View user's profile Send private message
KeyClick



Joined: 18 Jul 2008
Posts: 3
Location: USA

PostPosted: Sat Jul 19, 2008 10:20 pm    Post subject: Reply with quote

infogulch: Under the FileMoveDir help, the top sentence says- "Moves a folder along with all its sub-folders and files." However, my testing has shown it doesn't work that way. Then I noticed further down in the same help file it says this "FileMoveDir moves a single folder to a new location. To instead move the contents of a folder (all its files and subfolders), see the examples section of FileMove." Thanks.
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