Sign in with
Sign up | Sign in
Your question

Help for writing batch file to rename files in a folder in particular pattern.

Last response: in Windows XP
Share
December 16, 2011 8:32:00 AM

Hello,
I am new to writing batch files. So require help in writnig a batch file.

I have somme PDF files in a folder C:\Documents and Settings\Desktop\Static PDF.

The names of the PDF files in the above folder are as follows:

IND Regression Pending.pdf
IND Test Pending.pdf
IND Complete.pdf...........ans so on.

Now I want to write a batch file which will rename these files with same name. The only difference in new name being that instead of spaces it should put "_".

Example: 1) IND Regression Pending.pdf should be named as
IND_Regression_Pending.pdf

2) IND Test Pending.pdf should be named as
IND_Test_Pending.pdf

3 ) IND Complete.pdf should be named as
IND_Complete.pdf
............... and so on.
I have nearly 60-70 file and all need to be renamed in same manner.
Please if anyone can help coz its very urgent. Help will be appreciated.
December 16, 2011 10:44:08 AM

nbwshrjw said:
Hello,
I am new to writing batch files. So require help in writnig a batch file.

I have somme PDF files in a folder C:\Documents and Settings\Desktop\Static PDF.

The names of the PDF files in the above folder are as follows:

IND Regression Pending.pdf
IND Test Pending.pdf
IND Complete.pdf...........ans so on.

Now I want to write a batch file which will rename these files with same name. The only difference in new name being that instead of spaces it should put "_".

Example: 1) IND Regression Pending.pdf should be named as
IND_Regression_Pending.pdf

2) IND Test Pending.pdf should be named as
IND_Test_Pending.pdf

3 ) IND Complete.pdf should be named as
IND_Complete.pdf
............... and so on.
I have nearly 60-70 file and all need to be renamed in same manner.
Please if anyone can help coz its very urgent. Help will be appreciated.

In the time you would write & test a batch file, you could do it manually !
Right click & rename
!