Announcement

Collapse
No announcement yet.

Is there a way to....

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    #16
    Try this J
    Code:
    @echo off
    for %%a in (*.mkv) do (
        echo Found %%a
        echo - Making DIR %%~na
        mkdir "%%~na"
        echo - Moving %%~na.* to %%~na
        move "%%~na.*" "%%~na"
    )
    pause
    change *.mkv for any ext you like
    ie
    *.mkv;*.avi
    *.mkv;*.avi;*.divx

    it will move like named files into the same dir
    so if you have
    Iron_Man_3.mkv
    Iron_Man_3.srt
    it will move them together..


    if you want to change _ to spaces from the dir try this
    Code:
    @echo off
    setlocal enabledelayedexpansion
    for %%a in (*.mkv) do (
        echo Found %%a
        echo - Making DIR %%~na
        mkdir "%%~na"
        echo - Moving %%~na.* to %%~na
        move "%%~na.*" "%%~na"
        set foldername=%%~na
        echo - Renaming DIR to "!foldername:_= !"
        ren "!foldername!" "!foldername:_= !"
    )
    pause
    This one will rename the files inside the folder too... hopefully
    Code:
    @echo off
    setlocal enabledelayedexpansion
    for %%a in (*.mkv) do (
        echo Found %%a
        echo - Making DIR %%~na
        mkdir "%%~na"
        echo - Moving %%~na.* to %%~na
        move "%%~na.*" "%%~na"
        set foldername=%%~na
        echo - Renaming DIR to "!foldername:_= !"
        ren "!foldername!" "!foldername:_= !"
        cd "!foldername:_= !"
        for %%b in (*) do (
        	set filename=%%b
            echo - Renaming file "!filename!" to "!filename:_= !"
        	ren "!filename!" "!filename:_= !"
        )
        cd ..
    )
    pause
    Dun ask me where I keep all this info... I dunno where its all stored lmao
    Last edited by Sirex; 4 Nov 2013, 08:44 PM.




    I'm not insane. I'm just overwhelming!

    ·····••••• Support Cainslair. Donate here!•••••·····
    ·····••••• and get extra options! •••••·····

    Comment


      #17
      Thanks for those Sirex! What changes do I have to make to them if I don't want - or _? My file names with multiple words simply have spaces, and so do the folder names.

      Comment


        #18
        Use the first one, it does no stripping.
        Simple as that




        I'm not insane. I'm just overwhelming!

        ·····••••• Support Cainslair. Donate here!•••••·····
        ·····••••• and get extra options! •••••·····

        Comment


          #19
          Originally posted by Sirex View Post
          Use the first one, it does no stripping.
          Simple as that
          Will give it a test run this weekend. Thanks!

          Comment

          Cain's Lair Forums Statistics

          Collapse

          Topics: 26,187   Posts: 269,854   Members: 6,183   Active Members: 4
          Welcome to our newest member, Fermin13Q.

          Today's Birthdays

          Collapse

          There are no members with birthdays today.

          Top Active Users

          Collapse

          There are no top active users.

          More Posts

          Collapse

          • Reply to Hi guys!
            by Apache Warrior
            Hello Ghost. I hope you are doing well.
            Apache
            5 Jan 2025, 11:35 AM
          • Reply to Hi guys!
            by GhostHunter2024
            HAPPY NEW YEAR !!
            Well - just got back on my PC and played Delta Force game, Path of Exil 2, Diablo 4, BO6 and some WItcher3 , Ghost Recon Breakpoint...
            4 Jan 2025, 05:07 AM
          • Reply to New OLD "Private" is BACK to the LAIR
            by GhostHunter2024
            Yes, indeed. Have hardly time to GAME, to busy in the real world. Will see what 2025 brings and what games ?!
            Oh btw HAPPY NEW YEAR !!
            Best...
            4 Jan 2025, 05:02 AM
          Working...
          X