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.
Rename batch file
Name: apsley191 Date: February 23, 2009 at 13:53:18 Pacific OS: Windows XP Subcategory: Batch
Comment:
Hi - I'm hoping that someone out there can help. I have approx 200 folders each with a series of files called Tasveg; ie each folder contains Tasveg.shp, Tasveg.dbf, Tasveg.shx etc.
What I need to do is rename each set of files with a unique identifier eg Folder A containc TasvegA.shp, TasvegA.dbf, TasvegA.shx etc Folder B contains TasvegB.shp, TasvegB.dbf, TasvegB.shx etc Folder C contains TasvegC.shp, TasvegC.dbf, TasvegC.shx etc
Name: IVO Date: February 23, 2009 at 14:49:21 Pacific
Reply:
BEWARE: batch not tested
:: TASVEG.BAT Usage: tasveg
@echo off & setlocal EnableDelayedExpansion
set cnt=0
for /D %%i in (*) do (
set /A cnt+=1
pushd "%%i"
for %%j in (Tasveg.*) do (
ren %%j %%~nj-!cnt!%%~xj
)
popd
)
:: End_OF_Batch
0
Response Number 2
Name: apsley191 Date: February 23, 2009 at 19:12:27 Pacific
Summary: Hi all, I have been having problems writing a batch file to automate a process at work... Basically we have provided a folder for users to paste Lotus Notes archive .nsf files into which will be copie...
Summary: hi, m trying to run this batch file but it throws an error that the syntax is incorrect. pls help me with this set mypath=c:\documents and settings\ab48262 ren %mypath%\supplier.csv supplier1.csv aa...
Summary: Hi, I have a specific problem that I can't believe has not got a solution already. I have to rename some files that are in the format = (im1, im2, im3 ... im15, im16, ... im345, im 346) Windows orders...