Re: Need a script to rename a file 1600 times

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



Hello !

In Powershell you can write this :

1..1600 | foreach {cp c:\temp\test.pdf -dest c:\temp\test$_.pdf}

Best regards from France,

Arnaud PETITJEAN
MVP PowerShell
http://www.powershell-scripting.com

"Pegasus (MVP)" <I.can@xxxxxxx> a écrit dans le message de news:er1EgXDPIHA.3532@xxxxxxxxxxxxxxxxxxxxxxx

"Paco73" <Paco73@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message news:13289EBE-35BA-4EBB-A984-12CA4089869A@xxxxxxxxxxxxxxxx
I know this is a strange request, but I am looking for the best way to take a
PDF file and copy it 1600 times and rename it each time.

Example:

I have been asked to take C:\Temp\Test.pdf and make 1600 copies to
C:\Temp\PDF\Test1.pdf, Test2.pdf, ... Test1600.pdf.

I am a scripting noobie, have only really modified other scripts to fit what
I need, and am not real sure how to handle this request.

Thanks you in advance for your responses.

--
Thanks,

Paco

A simple command line will do:

for /L %a in (1,1,1600) do @copy c:\My.pdf /b /y c:\temp\PDF\test%a.pdf



.