Auto Duplicate file X Times ?

Page 4 of 4 FirstFirst ... 234

  1. Posts : 2
    Windows 10 Pro
       #31

    Bree said:
    Welcome to Ten Forums.

    Glad you like it. I have added a prefix to the count in the copy's filename that is initially empty, but will be set to 0 if the count is 9 or less. As the count is running down from your specified number, when it reaches 9 the filename will say '(Copy 09)' now.

    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=.
    set prefix=
    
    :repeat
    if %count% LEQ 9 set prefix=0
    @echo on
    copy %2 "%destination%\(Copy %prefix%%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
    That is perfect!!! How can I buy you a beer or coffee??
      My Computer


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

    Tayl0124 said:
    That is perfect!!! How can I buy you a beer or coffee??

    LOL - just pass it on, do something nice for someone else. It could start a trend
      My Computers


  3. Posts : 1
    Windows 10
       #33

    Bree said:
    Yes. That is a relatively easy change to make. Use MultiCopy2.bat (attached in a .zip). Drop the extracted .bat into the folder where you want to make duplicates and run it, you'll be asked for a file name and the number of copies. This one can cope with spaces in the file name.


    Well, normally I'd say just ask away, but this could grow into a very long thread that way

    I Googled for a CMD guide for you, there are many out there, but most are not very good. The link I gave at the bottom of post #7 is the best one I found, if you wish to learn more.
    Hello Bree, can you post a txt version of your MultiCopy2.zip, i cannot dnl that one somehow.

    Regards
      My Computer


  4. Posts : 31,622
    10 Home x64 (22H2) (10 Pro on 2nd pc)
       #34

    sonderaxe said:
    Hello Bree, can you post a txt version of your MultiCopy2.zip, i cannot dnl that one somehow.
    Here is the text of MultiCopy2.bat that's in the .zip file in post #12

    Code:
    @echo off
    echo.
    echo %0 will make the specified number of copies of a file to the current folder
    echo You need to provide the full name of the file including the extension(eg: test.txt)
    echo The copies will have '(Copy n)' added at the beginning of the filename, where 'n' is the count
    echo.
    :file
    set /p source="Name of file to copy ? : "
    if exist "%source%" goto number
    echo File %source% not found.
    goto file
    
    :number
    set /p count="How many copies to make ? : "
    if %count% LEQ 0 goto number
    set num=%count%
    :repeat
    copy "%source%" "(Copy %count%) %source%"
    set /a count=%count%-1 
    if %count% LEQ 0 echo Requested number of copies (%num%) have been made.
    if %count% LEQ 0 goto end
    goto repeat
    
    :end
    pause
      My Computers


  5. Posts : 2
    Windows 10
       #35

    Overwrite Function?


    Hi all,
    I found this thread and it has helped me immensely so thank you for putting it here.
    I think I have an understanding of the code and I've tried to fiddle with it so that it will automatically overwrite any existing files but I'm not having much luck.

    I could be mixing switched though as I've been trying xcopy switches.

    @echo off

    :next1
    set count=%1
    set destination=%2
    if "%2"=="" set destination=.

    :repeat
    xcopy c:\users\User1\music\ e:\ /i

    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

    Basically I'm trying to copy files repeatedly to a HDD until it is full.

    Thank you
    David
      My Computer


  6. Posts : 2,911
    Windows 10 Pro for the Bro
       #36

    Mothrat said:
    Basically I'm trying to copy files repeatedly to a HDD until it is full.
    I have a different suggestion for this.
    Check out FileFiller:

    Auto Duplicate file X Times ?-image.png

    In the picture above, my example is to create a text file that's 100 KB big filled with "spaces in a text document".

    Auto Duplicate file X Times ?-image.png

    Auto Duplicate file X Times ?-image.png

    You can make one very big file, doesn't have to be a text file (the default extension the app uses is a ".dat" file.)
    This way, you don't have to create so many duplicates of files that may accidentally get erased in the future by some "3rd party computer cleaner" program that finds duplicate files and deletes them.
      My Computer


  7. Posts : 2
    Windows 10
       #37

    Thanks.
    Actually that helps with an alternative solution.

    D
      My Computer


  8. Posts : 2,911
    Windows 10 Pro for the Bro
       #38

    You're welcome =)
      My Computer


  9. Posts : 1
    Windows 10
       #39

    @Bree and @beltman713
    Really helpful stuff, saved me a lot of time (and thinking

    Thx!
      My Computer


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

    solutioner said:
    @Bree and @beltman713
    Really helpful stuff, saved me a lot of time (and thinking

    Thx!
    Welcome to Ten Forums.

    Glad it could help.
      My Computers


 

  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 19:51.
Find Us




Windows 10 Forums