DonationCoder.com forum
 
Read-only archive. This is a static copy of the DonationCoder.com forum. Reading and searching work as before; logging in, posting and private messages do not.
Archive of 2026-10-21 · About this archive · Main site

Author Topic: IDEA: Synch Folders NOT files  (Read 8,336 times)

CleverCat

  • Cat's Are Fun!
  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 1,164
IDEA: Synch Folders NOT files
« on: April 22, 2007, 02:08 PM »
I have yet to find a programme that will synchronize Folders by name and not the files in them.

This would be useful when backing up to a USB drive apps which contain lots of Folders for skins -  like Window Blinds/Rainlender etc....the files inside are not important. I use Free Commander and it's great but cannot compare/synch a whole folder in side by side panes. :(
If you need help - JUST ASK!

skrommel

  • Fastest code in the west
  • Developer
  • Joined in 2005
  • ***
  • Posts: 933
    • Participated in NANY Challenge Twice
    • Coding Snacks
Re: IDEA: Synch Folders NOT files
« Reply #1 on: April 22, 2007, 07:28 PM »
:) Try this "DOS" command:

Code
XCOPY <source> <target> /E /T
Skrommel

CleverCat

  • Cat's Are Fun!
  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 1,164
Re: IDEA: Synch Folders NOT files
« Reply #2 on: April 23, 2007, 06:50 AM »
How does that work? - I'm not very 'au fait' with the command window unless I have step by step instructions!  :-[
If you need help - JUST ASK!

skrommel

  • Fastest code in the west
  • Developer
  • Joined in 2005
  • ***
  • Posts: 933
    • Participated in NANY Challenge Twice
    • Coding Snacks
Re: IDEA: Synch Folders NOT files
« Reply #3 on: April 23, 2007, 10:09 AM »
:) Press Win-R, enter CMD /K XCOPY <source> <target> /E /T and press Enter (replace the <source> and <target> parameters with something like C:\ or D:\Folders)

Or add the command to a AutoHotkey script:

Code
;FolderCopy.ahk
Run,CMD /K XCOPY <source> <target> /E /T

Skrommel

alexk7110

  • Supporting Member
  • Joined in 2007
  • **
  • Posts: 8
Re: IDEA: Synch Folders NOT files
« Reply #4 on: May 11, 2007, 10:55 PM »
If only I knew this a couple of years ago..
I've had to create a set of batch scripts that one would copy folder names on a text file and then have another one read it  as parameters for a "for every - in - do" mkdir command. argghhhh.. Oh, well now I know, thanks Skrommel for the tip..

PlayPhil

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 24
Re: IDEA: Synch Folders NOT files
« Reply #5 on: May 12, 2007, 12:54 PM »
If you are constantly sync'g a folder, for instance My Documents, you can also setup a shortcut...

Code
%windir%\system32\cmd.exe /K xcopy "C:\My Documents" "H:\My Documents" /E/T

where H is a valid path to another drive in this case, a USB stick for example. Note the quotes are necessary when there are spaces in the pathname. I use quotes all the time whether there's spaces or not.

Similarly, a shortcut to use Skrommel's EjectCD script...

Code
%windir%\system32\cmd.exe /C pushd "C:\Skrommel\CdOpenClose" && EjectCD.exe G

where /C closes the cmd wndo after completion, and G is the CD/DVD drive. I use 'pushd' since the path to the directory is not defined, ie, not in the path variable on my system. Also in the shortcut definition, the cmd wndo is run minimized, I use the icon from EjectCD and the shortcut resides in the Quick Launch menu - very handy, quick too :)

Amazing how many are not familiar with xcopy, yet it's fast, very functional and totally reliable
Phil

patthecat

  • Member
  • Joined in 2006
  • **
  • Posts: 88
Re: IDEA: Synch Folders NOT files
« Reply #6 on: May 12, 2007, 03:50 PM »
The command line command called Robocopy.exe (found in Microsoft Windows Resource Kits) can be used to synchronize subdirectories with the /MIR  (mirror) switch.

The link below basically shows a screen which shows what I'm talking about above with the robocopy output displaying the run statistics:
http://www.simplefailover.com/kb.aspx?kbid=1013

If you do not want to deal with the command line, then a Microsoft Software Engineer has also created a  windows GUI for robocopy.  See link below:
http://www.microsoft.com/technet/technetmag/issues/2006/11/UtilitySpotlight/

When doing backups of a doctor's Electronic Medical Records data, I first copy the live production data onto a separate drive.  I then make archives/backups off of this copy.  I am currently using an xcopy script but will be migrating to another script using robocopy with the /MIR option since I think it's more robust than xcopy.  On subsequent runs, only files which were added, changed, deleted from both source and destination directories will be processed rather than every file being copied to the destination directory.


patrick

Original address: https://www.donationcoder.com/forum/index.php?topic=8203.0