Batch Scripting Moving files with timestamp

前端 未结 3 612
北海茫月
北海茫月 2021-01-17 01:40

So basically I have a file system C:\\Test\\BaseLine. Under BaseLine folder I have many folders, it could be one folder or 15 folders, in those folders are image files. I wa

3条回答
  •  慢半拍i
    慢半拍i (楼主)
    2021-01-17 02:19

    BEFORE running draft.bat

    D:\>dir "d:\test\baseline", "d:\test\baseline\Folder 123", "d:\test\baseline\Folder 321"
    Volume in drive D is New Volume
    Volume Serial Number is B04C-AB59
     Directory of d:\test\baseline
    
    23/07/2014  21:24              .
    23/07/2014  21:24              ..
    23/07/2014  20:35                 2 1.jpg
    23/07/2014  20:35                 2 2.jpg
    23/07/2014  20:36              Folder 123
    23/07/2014  20:37              Folder 321
                   2 File(s)              4 bytes
    
     Directory of d:\test\baseline\Folder 123
    
    23/07/2014  20:36              .
    23/07/2014  20:36              ..
    23/07/2014  20:36                 2 3-tasty.jpg
    23/07/2014  20:36                 2 3-not tasty.jpg
    23/07/2014  20:36                 2 4-tasty.jpg
    23/07/2014  20:36                 2 4-not tasty.jpg
                   2 File(s)              4 bytes
    
     Directory of d:\test\baseline\Folder 321
    
    23/07/2014  20:37              .
    23/07/2014  20:37              ..
    23/07/2014  20:37                 2 5-tasty.jpg
    23/07/2014  20:37                 2 5-not tasty.jpg
    23/07/2014  20:37                 2 6-tasty.jpg
    23/07/2014  20:37                 2 6-not tasty.jpg
                   2 File(s)              4 bytes
                   2 Dir(s)   7,037,329,408 bytes free
    
    D:\>draft.bat
    

    AFTER

    D:\test\baseline>cd\
    
    D:\>dir d:\test\Achieve
     Volume in drive D is New Volume
     Volume Serial Number is B04C-AB59
    
     Directory of d:\test\Achieve
    
    23/07/2014  21:24              .
    23/07/2014  21:24              ..
    23/07/2014  20:36                 2 3_23-07-2014.jpg
    23/07/2014  20:36                 2 4_23-07-2014.jpg
    23/07/2014  20:37                 2 5_23-07-2014.jpg
    23/07/2014  20:37                 2 6_23-07-2014.jpg
                   4 File(s)              8 bytes
                   2 Dir(s)   7,037,329,408 bytes free
    
    
     Directory of d:\test\baseline
    
    23/07/2014  21:24              .
    23/07/2014  21:24              ..
    23/07/2014  20:35                 2 1.jpg
    23/07/2014  20:35                 2 2.jpg
    23/07/2014  20:35                 2 3.jpg
    23/07/2014  20:35                 2 4.jpg
    23/07/2014  20:35                 2 5.jpg
    23/07/2014  20:35                 2 6.jpg
                   2 File(s)              4 bytes
    

    Notice how baseline does not have any more folders because they all got deleted after moving all of files
    non-tasty -> baseline without non-tasty extension
    tasty -> achieve without tasty but with date stamp

    I hope you can understand now. Thanks a lot

提交回复
热议问题