Results 1 to 4 of 4

Thread: Batch Folder Creation and File Moving

  1. #1
    Founders Eddie's Avatar
    Quatar
       Quatar
    Join Date
    Mar 2012
    Posts
    5,251

    Awards Showcase

    Thanks Thanks Given 
    1,392
    Thanks Thanks Received 
    3,661
    Thanked in
    1,621 Posts

    Batch Folder Creation and File Moving

    Ok then, so, in need of some major geek assistance here.

    I have a load of files currently in a folder and I want to put each into folder of its own within the same directory. Each folder should have the same name as the file it contains (in short I want all my movies moved from the "movies" folder, into "movies\moviename".

    Is there any way I can do this quickly with either a script of some kind, or is there a clever program out there that can do it for me? I'd really like to avoid doing it manually with over 200 files.

  2. #2

    Da FAC?


    476vFG GC
    Founding member
    Stuka's Avatar
    Belgium
       Belgium
    Join Date
    Mar 2012
    Posts
    9,183

    Awards Showcase

    Thanks Thanks Given 
    1,446
    Thanks Thanks Received 
    7,310
    Thanked in
    3,103 Posts
    Powershell script.
    Edit the first line to have your source folder.

    Code:
    $folder = "c:\temp"
    
    Get-Childitem $folder | %{
        $newdir = $folder+"\"+$_.BaseName
        New-Item $newdir  -type directory
        Move-Item $_.fullname -Destination $newdir    
    }

    Providing CAS when you're all out of HUA!

  3. The Following 2 Users Say Thank You to Stuka For This Useful Post:

    Eddie (21Jan17), Energy (17Jan17)

  4. #3

    TWOT


    476th vFG Command Staff
    Oliver's Avatar
    Netherlands
       Netherlands
    Join Date
    Jun 2015
    Posts
    3,586

    Awards Showcase

    Thanks Thanks Given 
    743
    Thanks Thanks Received 
    1,814
    Thanked in
    951 Posts
    If you want some more magic: https://www.advancedrenamer.com/

    Website looks crappy, program is really nice tho. Requires some time to come up with your own requirements for renaming but can do a lot.


    A mission’s execution often reflects the quality, discipline, and tone set in the briefing. - Chris “Kimos” Haave

  5. The Following User Says Thank You to Oliver For This Useful Post:

    Eddie (21Jan17)

  6. #4
    Founders Eddie's Avatar
    Quatar
       Quatar
    Join Date
    Mar 2012
    Posts
    5,251

    Awards Showcase

    Thanks Thanks Given 
    1,392
    Thanks Thanks Received 
    3,661
    Thanked in
    1,621 Posts
    Yep, that worked, thanks guys.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Like our website?

You can help us by donating to cover our costs.

Many sincere thanks!


Search

Follow us

Twitter Twitter youtube