■20240413より前ファイルのみコピーするサンプルプログラム
PowerShell
1$aaaa = "C:\CopyMOTO" # コピー元のフォルダ
2$bbbb = "C:\CopySAKI" # コピー先のフォルダ
3$cccc = "20240413" # 20240413より前ファイルのみコピー
4Get-ChildItem -LiteralPath $aaaa -Force | Where-Object {-not $_.PSIsContainer} | Where-Object {($_.BaseName.Substring(($_.BaseName.Length)-8,8)) -lt $cccc} | ForEach-Object {Copy-Item $_.FullName $bbbb}
5
6
7<#
820240413より前ファイルのみコピー
9コピー元
10test1_20240410.txt
11test1_20240411.txt
12test1_20240412.txt
13test1_20240413.txt
14test1_20240414.txt
15
16コピー先
17test1_20240410.txt
18test1_20240411.txt
19test1_20240412.txt
20#>