locked
MULTIPLE COPIES OF A FILE RRS feed

  • Question

  • Hi. I an completely new to scripting.

    I found an answer on your site for making multiple copies of a known file :

    1..10 | % { copy-Item "C:\filename*.tif" "C:\filename$_.tif"}

    However, the name of the file I need to copy is different each time.

    Can you please show me how I can get the filename each time?

    And also a user input for the number of copies?

    Most obliged. Simon.

    Thursday, February 28, 2019 7:59 PM

All replies

  • You might start with learning the very basics of Powershell.

    Learn PowerShell: Microsoft Virtual Academy - Getting Started with Microsoft PowerShell.

    When you post code, please format it as code using the code posting tool provided on the edit bar of the post editor. Thanks.

    When you know the basics you should pay special attention to the cmdlets Read-Host. This could be one possible way to get user input.


    Live long and prosper!

    (79,108,97,102|%{[char]$_})-join''

    • Proposed as answer by jrv Thursday, February 28, 2019 11:51 PM
    Thursday, February 28, 2019 9:58 PM