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

Author Topic: i want to make a file name changer.  (Read 2869 times)

0 Members and 1 Guest are viewing this topic.

ogelami

    Topic Starter


    Beginner
  • Ogelami
    i want to make a file name changer.
    « on: August 12, 2008, 04:00:58 AM »
    I have a lots of music, and lots of them have an underscore in lots of places eg.
    blabla_bla_-_blabla.mp3 i want to replace all underscores with spaces instead.

    I also have a few game folders i with CD in the name that i want to remove eg.
    CD Blabla i want to remove the CD in the name of the folder.


    Thank you. =)
    09314M!

    Sidewinder



      Guru

      Thanked: 139
    • Experience: Familiar
    • OS: Windows 10
    Re: i want to make a file name changer.
    « Reply #1 on: August 12, 2008, 05:18:46 AM »
    Quote
    I have a lots of music, and lots of them have an underscore in lots of places eg.
    blabla_bla_-_blabla.mp3 i want to replace all underscores with spaces instead.

    If you can read the hieroglyphics on the wall, you are welcome to try this. Note: This was literally tested with blabla_bla_-_blabla.mp3.

    Code: [Select]
    @echo off
    setlocal enabledelayedexpansion

    for %%V in (c:\temp\*.mp3) do (
      set newname=%%~nxV
      set newname=!newname:_= !
      ren "%%V" "!newname!"
    )

    Be sure to point to your directory.

    Quote
    I also have a few game folders i with CD in the name that i want to remove eg.
    CD Blabla i want to remove the CD in the name of the folder.

    This can be accomplished by tweaking the posted code. If it's only a few game folders, doing it manually might be faster than writing code.

    Good luck. 8)
    The true sign of intelligence is not knowledge but imagination.

    -- Albert Einstein

    ogelami

      Topic Starter


      Beginner
    • Ogelami
      Re: i want to make a file name changer.
      « Reply #2 on: August 12, 2008, 04:11:08 PM »
      Quote
      I have a lots of music, and lots of them have an underscore in lots of places eg.
      blabla_bla_-_blabla.mp3 i want to replace all underscores with spaces instead.

      If you can read the hieroglyphics on the wall, you are welcome to try this. Note: This was literally tested with blabla_bla_-_blabla.mp3.

      Code: [Select]
      @echo off
      setlocal enabledelayedexpansion

      for %%V in (c:\temp\*.mp3) do (
        set newname=%%~nxV
        set newname=!newname:_= !
        ren "%%V" "!newname!"
      )

      Be sure to point to your directory.

      Quote
      I also have a few game folders i with CD in the name that i want to remove eg.
      CD Blabla i want to remove the CD in the name of the folder.

      This can be accomplished by tweaking the posted code. If it's only a few game folders, doing it manually might be faster than writing code.

      Good luck. 8)


      Thank you very much, it helped but it doesn't make it in underfolders. :/
      its above 300gig games :o
      so its quite a few :)
      09314M!

      devcom



        Apprentice

        Thanked: 37
        Re: i want to make a file name changer.
        « Reply #3 on: August 13, 2008, 03:26:41 AM »
        dunno if this will work (i dont test it)

        change this

        Code: [Select]
        for %%V in (c:\temp\*.mp3) do (to
        Code: [Select]
        for /F %%V in ('dir /b /s *.mp3') do (
        ofc yor file must be in right folder
        Download: Choice.exe