New
#31
That is perfect!!! How can I buy you a beer or coffee??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