Elementary file rename problem.
Posted: 22 May 2008 12:25
First the obvious: I don't know much about batch files.
I have searched long and hard for my own solution before imposing here, but have not been able to locate a solution.
I'm trying to create a simple routine to rename all of the files on a CDROM (or directory) by prepending a number to the beginning of each of the original file names.
example:
Assuming the number = 100
original file name = ORIGFILENAME.txt
rewritten file name = 100ORIGFILENAME.txt
The code above produces the result below, which I have achieved by many different methods, which overwrites the first portion of the original file name with the text to be prepended instead of adding the text to the beginning.
original file name = ORIGFILENAME.txt
rewritten file name = 100GFILENAME.txt
Thanks in advance for your time.
r
I have searched long and hard for my own solution before imposing here, but have not been able to locate a solution.
I'm trying to create a simple routine to rename all of the files on a CDROM (or directory) by prepending a number to the beginning of each of the original file names.
example:
Assuming the number = 100
original file name = ORIGFILENAME.txt
rewritten file name = 100ORIGFILENAME.txt
Code: Select all
set n=100
echo %n%
xcopy e:\*.* D:\casephotos\%n%*.*
The code above produces the result below, which I have achieved by many different methods, which overwrites the first portion of the original file name with the text to be prepended instead of adding the text to the beginning.
original file name = ORIGFILENAME.txt
rewritten file name = 100GFILENAME.txt
Thanks in advance for your time.
r