Thursday, September 29, 2016

How to compare two files in Windows

Start-> cmd

on the commandline just write

FC file1 file2

Note that file1 and file2 stand for the full path to the files. Example:

FC C:\Users\Desktop\DB.docx C:\Users\Desktop\DB2.docx

It works just like Diff in Linux

Wednesday, June 22, 2016

How to backup automatically a file to a network

Just create a batch file with the following command:

robocopy source destination /xo /purge /e

Example for source would be: C:\desktop\myfolder
Example for destination would be: T:\backup\myfolder

The files deleted in the source will be deleted in the destination and just the files changed will be copied to the destination (high performance).

/E : Copy Subfolders, including Empty Subfolders.
/XO : eXclude Older - if destination file exists and is the same date or newer than the source - don't bother to overwrite it.
/PURGE :: delete dest files/dirs that no longer exist in source.