VideoHelp Forum




+ Reply to Thread
Results 1 to 6 of 6
  1. Member
    Join Date
    Dec 2005
    Location
    Canada
    Search Comp PM
    I have more than one file in the folder with WXYZDT2 in the file name.
    When I run the bat file it only picks up one of the files to rename (if I run it through a second time it picks up the next file).
    Can someone point out the error.?

    Set Hour=%Time:~-11,2%
    Set Minute=%Time:~-8,2%
    Set Second=%Time:~-5,2%
    Set TodayTime=%Hour%-%Minute%-%Second%

    for %%a in ("*WXYZDT2*.wtv") do call :newname "%%a"
    if %%a not==("*WXYZDT2*.wtv") then goto finish
    :newname
    rename %1 ch7_%TodayTime%.wtv
    :finish
    Quote Quote  
  2. Member
    Join Date
    Nov 2003
    Location
    Everywhere I want to be
    Search Comp PM
    Name collision.

    You're setting a constant value (the date-time string) and then trying to rename every file to the same value "ch7_(the value).wtv"

    The first rename works, the others try to work but there's already a "ch7_(the value).wtv" file so they can't rename and skip.
    Quote Quote  
  3. Member
    Join Date
    Dec 2005
    Location
    Canada
    Search Comp PM
    I thought the 'Seconds' ensure that the new names are different - I tried inserting 'Ping' values to cause a delay, but no effect.
    Is it taking one instant of time and using that value for all the files?
    Any suggestions?
    Quote Quote  
  4. Member DB83's Avatar
    Join Date
    Jul 2007
    Location
    United Kingdom
    Search Comp PM
    Indeed. But you have set your renaming outside the loop.

    You may wish to repeat the first 4 lines just after ':newname' so the first rename catches the first 4 lines and the rest will work off the repeat.
    Quote Quote  
  5. Member
    Join Date
    Dec 2005
    Location
    Canada
    Search Comp PM
    Thank you, I got it working - as long as it's from 10AM to Midnight - then it fails, probably because it tries to insert a space in the file name for hours that are a single digit?
    Any suggestions?
    Quote Quote  
  6. Member
    Join Date
    Dec 2005
    Location
    Canada
    Search Comp PM
    Update, I got it working for both one and two digit hours.
    Thank you for the suggestions;it put me on the correct path.

    for %%a in ("*WXYZDT2*.wtv") do call :newname "%%a"

    if %%a not==("*WXYZDT2*.wtv") then goto :end
    :newname
    move %1 c:\agk_rename

    cd\
    c:
    cd agk_rename

    REN %1 "* %Date:/= % %Time::=.%.wtv"
    echo processing "%~n1"

    move *.wtv "e:\recorded tv"

    cd\
    e:
    cd recorded tv

    :end
    Quote Quote  



Similar Threads

Visit our sponsor! Try DVDFab and backup Blu-rays!