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

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.
1 answer Last reply
More about help writing batch file rename files folder pattern
  1. 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
Ask a new question

Read More

PDF Desktops Windows XP