locked
Issue with 'RENAME' command in command list RRS feed

  • Question

  • I am in the process of creating approx 1.2 million PDF files.

    I am currently doing this in batches of 400.

    e.g. ___________________________________________________

    rename "c:\data\Student_fin\FIN127_.pdf" "AFS_0630209.pdf" ;
    rename "c:\data\Student_fin\FIN127_1.pdf" "AFS_0630217.pdf" ;
    rename "c:\data\Student_fin\FIN127_2.pdf" "AFS_0630225.pdf" ;
    rename "c:\data\Student_fin\FIN127_3.pdf" "AFS_0630233.pdf"

    ~

    rename "c:\data\Student_fin\FIN127_397.pdf" "AFS_0634522.pdf" ;
    rename "c:\data\Student_fin\FIN127_398.pdf" "AFS_0634530.pdf" ;
    rename "c:\data\Student_fin\FIN127_399.pdf" "AFS_0634549.pdf" ;

    ________________________________________________________

    One reason for doing this is that I wish to rename them from the generic name the output process gives the file to a more appropriate name.

    To this end I am setting up a text file from that program  that contains the 400 rename commands:

    However, when run it will only rename 380 files and the last file often is only partially renamed! Which creates a real mess.

    [I initially was using batches of 500 and the name script renames approx 450 names]

    What is going on here and is there a solution?

    Monday, May 19, 2014 1:46 AM

All replies

  • In looking at another issue I added the following as first line to my .BAT file.

    @Echo Off&SetLocal ENABLEDELAYEDEXPANSION

    Hooray!!!! This has fixed the chopping off and partial renaming problem....

    But... the other problem of the last 20 rename statements not working still holds.

    Note: if I manually rerun that .BAT file without making any changes the final 20 files are renamed correctly!

     

    Monday, May 19, 2014 4:33 AM