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 

Rename Synchronization Utility/Batch file generation?

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



Joined: 28 Nov 2004
Posts: 20
Location: USA

PostPosted: Sat Apr 26, 2008 9:23 pm    Post subject: Rename Synchronization Utility/Batch file generation? Reply with quote

I have been looking for this everywhere for some time, and then thought, perhaps, someone might have actually written a script that can do this "rename sync" thing already.

So, on my local drive I have a folder C:\PRODUCTS\ that contains many different subfolders, each with mutliple subfolders, eventually pointing to files: Images, Audio, Video, etc. A kind of hierarchical organization, if you will.
Of course, I archive all of this to my external archive drive, so as to back everything up, as well as freeing up local drive space, by deleting the local copies of the files that I am not currently using.

I do use a "synchronization program" that would compare data on my local drive and the external drive and then copy any new files from my local hard drive (that are not already on the external one). So far so good.

But what often happens is that I decide to rename a folder or a file on my local drive to give it a better name. Of course, then what happens is that I need to make a note of this rename and before running the synchronization utility rename all the folders on my external drive.

This is, needless to say, tedious - it's like doing everything twice (which is exactly what this is).

What I need is an automatic generation of a "renaming" batch file as I go through and manually (or not manually) rename files or folders in my local tree. I could then simply run this batch file next time I connect my external drive and would be sure that my folder/file names are still in sync (and after that I could synchronize the actual file changes).

As an example, if I decide to rename my C:\PRODUCTS\AudioData\ to C:\PRODUCTS\AudioData_Music\, I would do that by working in an explorer-type window, navigate to that folder, press F2, enter the new name, and in the same time the batch file, c:\rename.bat, would get an append in the form of
Code:
move x:\PRODUCTS\AudioData x:\PRODUCTS\AudioData_Music

where x: is my external drive letter.

So, thus far, the closest I could come up with is use Bulk Rename Utility and use its Log file to remember my renames. I am currently working on a script that will translate data like this (the BRU log file format)
Code:
4/26/2008 7:36:20 PM - Renamed "C:\PRODUCTS\CDBookletImages" to "C:\PRODUCTS\CDBookletData"


into something like what I said above:
Code:
move "x:\PRODUCTS\CDBookletImages" "x:\PRODUCTS\CDBookletData"


But maybe someone has already solved this "syncing" problem?

Thanks,
A
_________________
||||
------
!!
Back to top
View user's profile Send private message
engunneer



Joined: 30 Aug 2005
Posts: 6847
Location: Pacific Northwest, US

PostPosted: Sun Apr 27, 2008 2:18 am    Post subject: Reply with quote

better sync tools will handle those changes for you. I might recommend Microsoft's SyncToy, which does work quite nicely. There are other auto backup solutions, but I have not researched them.

Of course, you can also do what you want with AHK, but that is up to you.
_________________
Unless otherwise noted, all code is untested.
Common Answers: 1.(Loops, Viruses, etc.) 2. Search 3.RTFM
Back to top
View user's profile Send private message Visit poster's website
Anatoly Larkin



Joined: 28 Nov 2004
Posts: 20
Location: USA

PostPosted: Sun Apr 27, 2008 4:27 pm    Post subject: Reply with quote

Tried SyncToy - can't trust it.
There are cases where it will not recognize that the renamed folder is the same folder.
_________________
||||
------
!!
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