Copy folders and store them in text file to exclude once copied folders on next run

后端 未结 2 1482
-上瘾入骨i
-上瘾入骨i 2021-01-15 17:53

I try to write a script that can monitor a folder H:\\Start and copy a new subfolder with its files in H:\\Start to new location H:\\Target

2条回答
  •  慢半拍i
    慢半拍i (楼主)
    2021-01-15 18:40

    You don't need to store anything, you can use

    xcopy /d /s h:\start h:\target
    

    /D:mm-dd-yyyy
    Copy files changed on or after the specified date. If no date is given, copy only files whose source date/time is newer than the destination time.

    but if you need a list of the files you can just use a redirection :

    xcopy /d /s h:\start h:\target > logfile.txt
    

提交回复
热议问题