Copy ไฟล์เดิมซ้ำ ๆ ด้วย PowerShell

wk
1 min readMay 21, 2019

--

ตัวอย่าง

ต้องการ Copy ไฟล์ souce.pdf ซ้ำ 100 ไฟล์ โดยตั้งชื่อว่า target-1.pdf , target-2.pdf , target-3.pdf ถึง target-100.pdf

ให้เปิด PowerShell แล้วรันคำสั่งต่อไปนี้

1..100 | % { Copy-Item "c:\source.pdf" "c:\target-$_.pdf" }

--

--

No responses yet