Welcome guest. Before posting on our computer help forum, you must register. Click here it's easy and free.

Author Topic: .Bat File For Renaming Files That Are Allways Changing  (Read 3194 times)

0 Members and 1 Guest are viewing this topic.

TheMysticRealm

    Topic Starter


    Greenhorn

    .Bat File For Renaming Files That Are Allways Changing
    « on: August 21, 2010, 08:31:15 AM »
    Hi There

    I Wanting To Undergo A Tricky Operation How To Rename Files Without Specifying

    There Names   Example File 1 To 01.mp3 File 2 to 02.mp3

    Using This .Bat  File For My Sonic 2 Mp3 tool


    Any Help Will Be Greatly Appreciated

    mat123



      Hopeful

      Thanked: 16
      • Yes
      • Yes
      • Yes
    • Experience: Familiar
    • OS: Windows XP
    Re: .Bat File For Renaming Files That Are Allways Changing
    « Reply #1 on: August 21, 2010, 09:42:51 AM »
    Code: [Select]
    @echo off
    set ext=mp3
    setlocal ENABLEDELAYEDEXPANSION
    set path2=C:\test
    set a=1
    dir /s %path2%.\*.%ext% /b >%path2%.\%ext%.dir
    for /f "delims=" %%a in (%path2%.\%ext%.dir) do (
    set b=!a!
    if !a! lss 10 set b=0!b!
    ren "%%a" !b!.%ext%
    set /a a=!a!+1
    )
    del %path2%.\%ext%.dir
    C:\test is the folder of the mp3 files



    TheMysticRealm

      Topic Starter


      Greenhorn

      Re: .Bat File For Renaming Files That Are Allways Changing
      « Reply #2 on: August 21, 2010, 11:51:04 AM »
       :D That Has Worked Thanks So Much