• Batch Program

    Abhey Member

    So I was at work one day and my upper management wanted me to rename millions and millions of pictures by adding the date that it was taken behind the rest of the name. So I didn’t want to do it manually which is what the person before me had been doing you know right click change name. That would take forever so I created with the only resource I had available a batch file.

    Error(important):
    When the for loop goes through the tokens the rename doesn’t work saying that it is invalid. Not sure how to fix it as it was working until I finally got the date taken working.

    
    @echo off
    
    cls
    :CD
    SET add=0
    cls
    echo Change directory?
    echo.
    set /p "cho=>"
    if %cho%==y goto Change
    if %cho%==Y goto Change
    if %cho%==n goto Open
    if %cho%==N goto Open
    cls
    echo That's not a valid choice.
    pause
    goto CD
    :Open
    cls
    echo Change file name to:
    echo.
    set /p "newname=>"
    set i=0
    for %%X in ("*.jpg") do (
    ren %1 tree
    )
    pause
    goto end
    :Change
    cls
    echo Enter the desired directory.
    set /p "x=>"
    CD /D "%x%"
    goto Open
    :end
    

    Any help you could would be amazing. Thank you very much.

  • Adelaid Member

    instead of writing your own little batch, I’d use a prog that already is out there, example ( non tested ) :

    http://www.advancedrenamer.com/

Viewing 1 reply thread
  • You must be logged in to reply to this topic.