Duplicate a file multiple times using a PowerShell script


hi all,

i not powershell scripting , wondering if me.

what want copy single file multiple times , have renamed. example, copy document called document.txt 100 times document1.txt, document2.txt, document3.txt, document4.txt … files located in same folder

          $numarray = (1..100)

          foreach ($number in $numarray ) {

          ????

             }


hope can
colin





thanks

$numarray = (1..500)

foreach

($number in $numarray) {

copy-item "c:\users\colin\desktop\temp\doc.docx" -destination "c:\users\colin\desktop\temp\doc$number.docx"

}



Windows Server  >  Windows PowerShell



Comments

Popular posts from this blog

server manager error: ADAM.events.xml could not be enumerated.

Cannot access Anywhere Access using domain name?

WMI Failure: Unable to update Local Resource Group