This is the command I use all the time in windows vista and up. If you are using XP I think there is a pack you can download from microsoft that has it.
ROBOCOPY D:\MAME Z:\MAME /MIR
First dir is the source directory second is the destination. The MIR bit makes them exactly the same using size and timestamp as the filters. It will delete any files that are removed and add any that are missing and overwrite any that have changed leaving the rest alone. If you are using win7 and up you can add in /MT:4 and it will copy/scan 4 files at a time.
If you are using linux/mac/bsd you can use something like rsync to get the same affect.