Computing.Net > Forums > Programming > Renaming files to set names.

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

Renaming files to set names.

Reply to Message Icon

Name: SimonMercer
Date: September 17, 2009 at 02:42:09 Pacific
OS: Microsoft Windows XP Professional
CPU/Ram: 2.66 GHz / 2045 MB
Product: Dell / Dell xps710
Subcategory: Batch
Comment:

Hi, I have a 3D render scene for lighting studys. each time I press render I get a folder with 24 .jpg's named:
Render_frame_000, 001, 002etc with I would like to rename Light_study_0am, 1am, 2am etc. The rendered frames willl always come out with the same names, so i would like to be able to drop a .bat file in the said folder to rename them.
This is what iv started out with:

@echo off
title Renamer
dir
rename Render_frame_001.jpg %Light_study_6am%.jpg
rename Render_frame_002.jpg %Light_study_7am%.jpg
rename Render_frame_003.jpg %Light_study_8am%.jpg
rename Render_frame_004.jpg %Light_study_9am%.jpg
pause

but I get "the system cannot find file specified" I know this is a very noob question but when it comes to coding I am..
Any help would be greatly appreciated.
thanks Simon



Sponsored Link
Ads by Google

Response Number 1
Name: SimonMercer
Date: September 17, 2009 at 03:17:02 Pacific
Reply:

Hi, quick update. Replacing "rename Render_frame_001.jpg %Light_study_6am%.jpg" with "REN Render_frame_001.jpg Light_study_1am.jpg" seems to do the trick.
thanks for looking.


0

Response Number 2
Name: klint
Date: September 17, 2009 at 06:08:34 Pacific
Reply:

The % signs are used for variable substitution. I don't think you need them in your case. As you have found out yourself, it works when you remove them.


0

Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More






Use following form to reply to current message:

Login or Register to Reply
LoginRegister


Sponsored links

Ads by Google


Results for: Renaming files to set names.

Batch file to set proxy settings www.computing.net/answers/programming/batch-file-to-set-proxy-settings/10409.html

Batch to rename file to incl military time www.computing.net/answers/programming/batch-to-rename-file-to-incl-military-time/20240.html

Rename file to system date batch www.computing.net/answers/programming/rename-file-to-system-date-batch/15335.html