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.
Advance rename
Name: dveerl Date: February 10, 2006 at 22:05:22 Pacific OS: win xp CPU/Ram: pen4 512g Product: intel
Comment:
Hi I would like to write a batch file using rename - i need to schedule it .... I have a list of files in a dir My files do not have extension For example ABCDEFGHIJKL And I would like to change it to DIR-ABCDEFGHIJ.SLOT
1. Evrey file will start with DIR- 2. The last two letters of the file will be trimmed 3. File extension will be renamed to .SLOT
Name: shahramsh Date: February 11, 2006 at 11:01:15 Pacific
Reply:
this should do it:
give the path to the batch file as %1
@echo off set bn=%0 if "%1"==":trim" goto trim if "%1"==":dir" goto dir for /r %1 %%I in (*.*) do call %bn% :trim %%I %%~nI for /r %1 %%I in (*.*) do call %bn% :dir %%I %%~nI ren %1\* *.slot goto EOF :trim set x=%3 set x1=%2 set x2=%x:~0,-2% ren "%x1%" "%x2%" goto EOF :dir set x=%3 set x1=%2 set x2=DIR-%x% ren "%x1%" "%x2%" :EOF
0
Response Number 2
Name: dveerl Date: February 19, 2006 at 03:11:52 Pacific
Summary: hi there, im lokking for a batch file for renaming files. the hard thing is i want the extenions for the files from 001 to 002, 003 and so on. i receive the files in for example c:\in the are named FS...
Summary: Hi all, I’m stuck with a file renaming issue on a batch program I’m writing, if any one has a few minutes I’ll explain. I have a program that outputs a .jpg file. It captures a still image from ...
Summary: I am looking to rename folders at a specified location but only want to rename them if a text string exists in the folder name. I have another app that creates a set of randomly generated folder name...