Search : in
By :

Batch file to rename files in a folder

Last answer on Nov 8, 2009 4:39:16 pm GMT poorani, on Oct 29, 2009 8:32:34 am GMT 
 Report this message to moderators

Hello,
I had a folder with 550 image files in it. i need to change the name of the image files with respect to the data present in an excel.
e.g. i'm having one excel which contains Market code & the corresponding market names as shown below

Market Code Market Name
500 atlanta
600 boston.

The image files are stored in the name of "Market Names" .Now i need to change the file names w.r.to Market code.


can anyone suggest me a solution for the same

Configuration: Windows XP Internet Explorer 6.0

Best answers for « batch file to rename files in a folder » in :
Renaming multiple files in batch ShowRenaming multiple files in batch Native features Using a third-party program Renaming a large number of files can quickly become tedious. Fortunately, there are tools to automate this task in many cases: Native features On Windows...
Files and Folder hidden - how to fix? ShowFiles and Folder hidden - how to fix? Issue Solution Issue If you ever try accessing your partitions or flash drive, can't see any files or folders and you have checked the drive's properties and see that there's still data in it,...
[VIRUS] - Unable to apply Hidden Files/Folders Show[VIRUS] - Unable to apply Hidden Files/Folders Issue Solution Issue When I click "Show hidden files" in “Folder Options” and apply, there’s no change it still doesn’t show me any hidden file! Then I tried scanning using...
Download EF Multi File Renamer ShowEF Multi File Renamer is a versatile tool that lets you rename multiple files or folders (including subdirectories) and all this in one step. You can define your own rules of renaming or use the rules already predefined. Advantage Complex tasks...
Download File Renamer Basic ShowDo not try any more to rename manually all your files in mass after data transfer. File Renamer BASIC is a powerful utility to rename folders, files, films, images, etc… In fact, you can easily rename folders even the entire subfolders of image or...

2

 aprpillai, on Nov 5, 2009 7:53:19 am GMT

Hi,

Write a Macro to Read the Cell Ranges that contain Market Code & Market Name Values in a loop and take Market Code in one string Variable say: strMarketCode and Market Name in strMarketName and run the DOS Command REN in Shell command like the following to rename each file:

Call Shell("REN C:\MyFolder\" & strMarketName & " " & strMarketCode)

The shell command must be called for each file. It is better if you create a delay loop immediately after executing the above shell command to give some time to DOS to execute the command like the following:

T= timer
Do While timer < T+0.5
' delay
Loop

this will give a delay of half a second before running the next shell command. You may increase the time to one second or more.


Regards,
a.p.r. pillai

Reply to aprpillai