Auto Duplicate file X Times ?

Page 1 of 4 123 ... LastLast

  1. Posts : 317
    Windows 10 Home
       #1

    Auto Duplicate file X Times ?


    Unsure how to phrase or where to ask this Question.

    Simply, How can I set a number, for how many times i want a file to duplicate for me ?

    Rather than copy paste repeatedly until i get the exact number of duplicates of a file.

    What methods or software can I use to do this ?

    Example :


    Type in 50. Then press action, then the file in question duplicates that number of times. Done .



    I'd love a .bat file to do this drop it in the folder along with the file in question set a number or something . Or something in the right click context menu where such an option would appear ?
    Last edited by OtherWay1982; 21 Oct 2019 at 08:53.
      My Computer


  2. Posts : 42,963
    Win 10 Pro (22H2) (2nd PC is 22H2)
       #2
      My Computers


  3. Posts : 31,630
    10 Home x64 (22H2) (10 Pro on 2nd pc)
       #3

    OtherWay1982 said:
    ...I'd love a .bat file to do this...
    Here's a basic one to do the job. Copy all the code below, paste it into Notepad and save as MultiCopy.bat.

    Note that only basic 'sanity checks' are made, so it pauses after each copy to give you a chance to Ctrl-C out of an infinite loop. Also, the text '(Copy n) ' is added at the beginning of the filename, not the end (which would have added it to the file type extension). It would take some complicated parsing to find the extension in the filename and inset the copy count there.

    Code:
    @echo off
    echo.
    if NOT "%2"=="" goto next1
    
    echo %0 will make the specified number of copies of a file to (by default) the current folder
    echo The copies will have '(Copy n) ' added at the beginning of the filename, where 'n' is the count
    echo .
    echo Useage: %0 copies source_file [destination folder]
    echo example: %0 10 test.txt C:\temp
    goto end
    
    :next1
    if EXIST ".\%2" goto next2
    echo file %2 not found
    goto end
    
    :next2
    set count=%1
    set destination=%3
    if "%3"=="" set destination=.
    
    :repeat
    @echo on
    copy %2 "%destination%\(Copy %count%) %2"
    @echo off
    pause
    
    set /a count=%count%-1 
    if %count% LEQ 0 echo Requested number of copies (%1) have been made.
    if %count% LEQ 0 goto end
    
    goto repeat
    
    :end
      My Computers


  4. Posts : 317
    Windows 10 Home
    Thread Starter
       #4

    Okay I'll try these suggestions.

    - - - Updated - - -

    Bree

    I tried the bat but unsure what I'm doing wrong. Looks complicated. not sure what I'm supposed to change ,write in the fields, or even if im noticing the fields to fill out ?

    am i supposed to delete something ? i need like arrows and stuff pointing out what to do what to write examples etc.
      My Computer


  5. Posts : 31,630
    10 Home x64 (22H2) (10 Pro on 2nd pc)
       #5

    OtherWay1982 said:
    Bree I tried the bat but unsure what I'm doing wrong. Looks complicated. not sure what I'm supposed to change ,write in the fields, or even if im noticing the fields to fill out ?
    The bat file need no modification, just copy all of the text in the code box and save it as MultiCopy.bat. I made it pause after each copy so it's easy to use Ctrl+C to stop it if needed. Just press and hold any key (the spacebar, for instance) if you want to let it run fast.


    To use it, put a copy of the .bat in the folder where you want to make the duplicates. Open a command prompt, go to that folder with the CD command, then type:

    MULTICOPY followed by the number of copies you want, then the name of the file you want to duplicate.

    for example:

    Multicopy 4 test.txt

    Auto Duplicate file X Times ?-image.png
      My Computers


  6. Posts : 317
    Windows 10 Home
    Thread Starter
       #6

    Okay Ill try again.

    - - - Updated - - -

    Auto Duplicate file X Times ?-bat-file-probs.png

    seems im not even getting the path right. its just on my desktop but im really ignorant about CMD .How to use it ..

    - - - Updated - - -

    dalchina
    Quick File Duplicator l could use that, but the price is more than i want to spend at this time .
      My Computer


  7. Posts : 31,630
    10 Home x64 (22H2) (10 Pro on 2nd pc)
       #7

    OtherWay1982 said:
    seems im not even getting the path right. its just on my desktop but im really ignorant about CMD .How to use it ..

    I grew up with DOS so a command prompt is familiar territory to me, but now is probably not the best time for an in-depth instruction session

    Some basics to get you started.

    When you open a command prompt the prompt (the text ending with >) tells you the folder you are currently in. In your screenshot the initial prompt says: C:\Users\Outpo>

    To change directory to the folder (aka directory) you want, type the command CD followed by a space and the path of the folder. In the screenshot you typed C:\Users\Outpo\Desktop\test results

    Is that 'test results' folder on your Desktop where you have the file you want to duplicate? Is that where you put my .bat file? If so, as you are already in C:\Users\Outpo you just need to type the command CD Desktop\test results

    You'll know if it worked because the prompt should change to C:\Users\Outpo\Desktop\test results>

    Then you should be able to type the .bat file name, followed by a number and the filename to duplicate. NB, its a very simple .bat file and hasn't been written to cope with all possibilities. It won't work for file names that include spaces, so rename the file if it has any. For example, you_could_use_an_underscore_to_replace_a_space.



    There's a beginners guide to the Command Prompt here (it's for XP, but little has changed since then).

    Beginners Guides: Windows Command Prompt - PCSTATS.com
      My Computers


  8. Posts : 1,621
    Windows 10 Home
       #8

    Bree, i am unable to copy and paste your really cool batch-file from that live box into my new text file, can you make it a flat ascii text in a post?
      My Computer


  9. Posts : 31,630
    10 Home x64 (22H2) (10 Pro on 2nd pc)
       #9

    RolandJS said:
    Bree, i am unable to copy and paste your really cool batch-file from that live box into my new text file, can you make it a flat ascii text in a post?
    Nice of you to say, but it's really a 'bare bones' demonstration of principle. if I was to develop it further,it would need more work to cope with filenames with spaces, and putting the '(Copy n)' after the name but before the extension would be on the 'to do' list too. But here it is as it stands now, attached as a .zip file.
    Auto Duplicate file X Times ? Attached Files
      My Computers


  10. Posts : 317
    Windows 10 Home
    Thread Starter
       #10

    Is there a way to make it work without any need of the CMD ?

    Example I have a .bat file i got somewhere on the Internet: it creates a List names of the files for the folder its in ;
    into a .Text file; Pressing it once.




    dir /b >copylist.txt /b /o



    I just drop that .bat into the folder and press it .
    it does make two unnecessary entries into that list i have to delete every time:
    It lists "copylist" as part of the list along with the name the bat itself bears .

    But I wish it was that easy. Drop it into the folder of the file needing duplicated, run it, a dialog pops up asked the number of files to be made, done.

    Or like set the number to be duplicated in the Bat file itself.

    Or drop the file to be duplicated directly onto the bat.
    No clue what im saying but so far a bit too complicated for this . I still have alot to learn ..
      My Computer


 

  Related Discussions
Our Sites
Site Links
About Us
Windows 10 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 10" and related materials are trademarks of Microsoft Corp.

© Designer Media Ltd
All times are GMT -5. The time now is 14:48.
Find Us




Windows 10 Forums