How do I write a batch script that copies one directory to another, replaces old files?

前端 未结 5 583
爱一瞬间的悲伤
爱一瞬间的悲伤 2021-02-01 09:59

I\'d like a batch script in Windows with which I can copy one directory to another. If this directory already exists, and then for each file that already exists in both with the

5条回答
  •  自闭症患者
    2021-02-01 10:26

    It seems that the latest function for this in windows 7 is robocopy.

    Usage example:

    robocopy   /e /xf  
    

    /e copies subdirectories including empty ones, /xf excludes certain files from being copied.

    More options here: http://technet.microsoft.com/en-us/library/cc733145(v=ws.10).aspx

提交回复
热议问题