Solved

Script or free program to copy files in numerical order

Posted on 2008-10-20
3
192 Views
Last Modified: 2012-05-05
hi, i am looking for a simple way to create an X number of copys of a file.
so that if i have one file named

filename0000.tif

i´d like to create x number of copys only call them filename0001.tif - filename9999.tif

any ideas ?
0
Comment
Question by:Hoddi1
  • 2
3 Comments
 
LVL 13

Assisted Solution

by:Brum07
Brum07 earned 150 total points
ID: 22756491
0
 
LVL 13

Accepted Solution

by:
Brum07 earned 150 total points
ID: 22756581
Sorry, forgot to tell you how to do it.

Use this VBScript to copy the file 1000 times;

set fso = CreateObject("Scripting.FileSystemObject")
For i = 1 to 1000
FSO.CopyFile "C:\temp\test.txt","C:\temp\test.txt" & i
Next

changing the locations as required, then use The Rename program to rename as needed.

Regards
0
 
LVL 38

Assisted Solution

by:Shift-3
Shift-3 earned 100 total points
ID: 22757760
Here is a way to do it in batch.

Paste the script below into a text file with a .cmd extension.  Running it will create copies numbered from 0001 to 9999.


@echo off
setlocal enabledelayedexpansion
 
set source=filename0000.tif
set base=filename
set ext=.tif
 
for /L %%G in (1,1,9999) do (
 set num=000%%G
 set num=!num:~-4!
 echo F|xcopy "%source%" "%base%!num!%ext%" /C /H /R /Y
)

Open in new window

0

Featured Post

Back Up Your Microsoft Windows Server®

Back up all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Use this article to create a batch file to backup a Microsoft SQL Server database to a Windows folder.  The folder can be on the local hard drive or on a network share.  This batch file will query the SQL server to get the current date & time and wi…
With User Account Control (UAC) enabled in Windows 7, one needs to open an elevated Command Prompt in order to run scripts under administrative privileges. Although the elevated Command Prompt accomplishes the task, the question How to run as script…
Viewers will learn how to maximize accessibility options in an Excel workbook for users with accessibility issues.
The viewer will learn how to create two correlated normally distributed random variables in Excel, use a normal distribution to simulate the return on different levels of investment in each of the two funds over a period of ten years, and, create a …

685 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question