Last active
          July 9, 2022 07:56 
        
      - 
      
 - 
        
Save huanlin/e0e57c6902cedbbc2d9229f8b4290ad9 to your computer and use it in GitHub Desktop.  
    Multiple Masks with forfiles and for commands
  
        
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | REM 把需要備份的檔案名稱全丟到 filelist.txt 裡面 | |
| del filelist.txt | |
| for %m in (.txt, .pdf, .xls, .xlsx, .xlsm, .doc, .docx, .docm) | |
| do (forfiles /S /M *%m /D +2021/01/01 /C "cmd /c echo @path" >> filelist.txt) | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | REM 把需要備份的檔案名稱全丟到 filelist.txt 裡面 | |
| del filelist.txt | |
| forfiles /S /M "*.txt" /D +2021/01/01 /C "cmd /c echo @path" >> filelist.txt | |
| forfiles /S /M "*.pdf" /D +2021/01/01 /C "cmd /c echo @path" >> filelist.txt | |
| forfiles /S /M "*.xls" /D +2021/01/01 /C "cmd /c echo @path" >> filelist.txt | |
| forfiles /S /M "*.xlsx" /D +2021/01/01 /C "cmd /c echo @path" >> filelist.txt | |
| forfiles /S /M "*.xlsm" /D +2021/01/01 /C "cmd /c echo @path" >> filelist.txt | |
| forfiles /S /M "*.doc" /D +2021/01/01 /C "cmd /c echo @path" >> filelist.txt | |
| forfiles /S /M "*.docx" /D +2021/01/01 /C "cmd /c echo @path" >> filelist.txt | |
| forfiles /S /M "*.docm" /D +2021/01/01 /C "cmd /c echo @path" >> filelist.txt | 
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment