Jump to content

Sky Slate Blueberry Blackcurrant Watermelon Strawberry Orange Banana Apple Emerald Chocolate
Photo

Compare Contents of Folder to Another and Make them the Same


  • Please log in to reply
8 replies to this topic
jmk123
  • Members
  • 14 posts
  • Last active: Jul 16 2013 08:27 AM
  • Joined: 13 Jun 2012
I am looking for a way to compare Folder A to Folder B in this way:
- For all files/subfolders in Folder A that are not in Folder B, copy them to Folder B
- For all files/subfolders in Folder B that are not in Folder A, delete them from Folder B

What I'm trying to do here is make it easier to copy my music from my computer to my phone's SD card. I am constantly adding and deleting music from my computer, and I want to be able to run a script that will just make the music on the SD card exactly the same as the music on my computer.

It takes a long time to copy the amount of music I have over, so I can't just delete all the music from the SD card and copy the whole music folder from my computer. Hence why I need a script which will actually compare the contents and only delete the files which I've deleted from my computer, and add the files I've added.

Does anyone have any ideas on how I would do something like this? Alternatively, does anyone know a way to do something like this without AutoHotKey?

Grendahl
  • Members
  • 416 posts
  • Last active: Jul 07 2014 08:01 PM
  • Joined: 10 Aug 2009
<!-- m -->http://www.rdcomp.net/ezback-it-up<!-- m -->
Always have your scripts when you need them with Dropbox.
Sign up for free! http://db.tt/9Hrieqj

Learning one
  • Members
  • 1483 posts
  • Last active: Jan 02 2016 02:30 PM
  • Joined: 04 Apr 2009
It can be done in AutoHotkey, but I use and recommend FreeFileSync for things like that. Use Mirror sync option.

My Website • Recommended: AutoHotkey Unicode 32-bit • Join DropBox, Copy


Grendahl
  • Members
  • 416 posts
  • Last active: Jul 07 2014 08:01 PM
  • Joined: 10 Aug 2009
+1 for FreeFileSync. Good call, Learning one.
Always have your scripts when you need them with Dropbox.
Sign up for free! http://db.tt/9Hrieqj

jmk123
  • Members
  • 14 posts
  • Last active: Jul 16 2013 08:27 AM
  • Joined: 13 Jun 2012
Thanks guys, looks like FreeFileSync will do the job perfectly. :)

MasterFocus
  • Moderators
  • 4323 posts
  • Last active: Jan 28 2016 01:38 AM
  • Joined: 08 Apr 2009
There's also RichCopy, in case anyone is interested in alternatives.

-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

Antonio França -- git.io -- github.com -- ahk4.net -- sites.google.com -- ahkscript.org

Member of the AHK community since 08/Apr/2009. Moderator since mid-2012.


acewp
  • Members
  • 13 posts
  • Last active: Oct 17 2014 06:23 AM
  • Joined: 28 Aug 2012

Another alternative is the freeware Allway Sync. It has simple UI yet powerful. It also has portable version.



T800
  • Members
  • 107 posts
  • Last active: Feb 01 2014 11:14 PM
  • Joined: 15 Oct 2006

I can recommend SyncBack, I use it for managing my backups. It has free version, easy to use and has lots of options for managing files.



Seidenweber
  • Moderators
  • 638 posts
  • Last active: Sep 06 2015 01:51 PM
  • Joined: 10 May 2011

RoboCopy is shipped with Windows 7, Windows 8, Windows Server 2008, Windows Server 2008 R2 and Windows Server 2012.


All questions & answers are related to AHK 1.1.19.03 x64 Unicode