Computing.Net > Forums > Office Software > Batch file renaming

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.

Batch file renaming

Reply to Message Icon

Name: Bob8788
Date: May 18, 2008 at 12:27:56 Pacific
OS: Windows
CPU/Ram: 512
Product: Tiom
Comment:

I have a bunch of files named Invoice # xxxx.PDF that I would like to change to be Invoice xxxx.PDF. Does anyone know how to do that with a bash script? So far I have been thwarted in every attempt.




Sponsored Link
Ads by Google

Response Number 1
Name: Bob8788
Date: May 18, 2008 at 12:28:21 Pacific
Reply:

I use InnoRename to rename my huge picture files from my photo and my mp3 files too.
Great program to try (find it there www.innoplanet.com).
It can be programed and you can do a lot of combination easily.
Try it.


0

Response Number 2
Name: IVO
Date: May 18, 2008 at 13:59:34 Pacific
Reply:

The question belongs to the Programming Forum, but
the following batch script (not bash!) does the job. That works in Win NT/2K/XP only NOT under Win 9X/ME.

@echo off & setlocal EnableDelayedExpansion
for %%j in (invoice*.pdf) do (
set file=%%~nxj
set file=!file:# =!
echo ren "%%j" "!file!"
)
:: End_Of_Batch

When you are sure it works as you planned, remove the echo in front of ren to make the renaming effective.

However I don't understand why you can't use your great InnoRename to do the job.


0

Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More







Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Office Software Forum Home


Sponsored links

Ads by Google


Results for: Batch file renaming

run batch file with excel www.computing.net/answers/office/run-batch-file-with-excel/3782.html

batch file to refresh RAM www.computing.net/answers/office/batch-file-to-refresh-ram-/8562.html

Batch file www.computing.net/answers/office/batch-file/9521.html