Move all files created today from network location to local drive

后端 未结 1 1801
太阳男子
太阳男子 2021-01-29 05:54

Using my below given script, I simply wanted to cut-paste all the .dat files created today from source to destination, where source is a network path.

@echo off
         


        
相关标签:
1条回答
  • 2021-01-29 06:13

    In PowerShell:

    $src = '\\10.xx.xx.xxx\shared\files'
    $dst = "D:\Data\Backup\$(Get-Date -f 'yyyyMMdd')"
    mkdir $dst
    
    Get-ChildItem $src -File | Where {$_.LastWriteTime -gt (Get-Date).Date} | Copy-Item $dst
    
    0 讨论(0)
提交回复
热议问题