is there a easy way to put videos into individual folders

If your files are named properly already then stick this in a file called 'sort.bat' in the folder where your files are, double-click it and hope for the best :o:

Code:
@ECHO OFF
FOR /f "tokens=1-2 delims=." %%A IN ('dir /b *.avi') DO (
	mkdir "%%A"
	move "%%A.%%B" "%%A"
)

(change avi to whatever format you want)

Basically for each .avi file in your folder it makes a directory called the name of the file and then moves the file into that directory.
 
Last edited:
Aww, beaten to it by Pho. Though I was going to suggest PowerShell! :D

Code:
gci -filter *.avi | % { new-item -ItemType directory -Name $_.BaseName; Move-Item $_ (Join-Path $_.BaseName $_.Name)}

Pho's is probably easier to do! :)
 
Create a new file called sort.bat in the folder with all your .avi files.
Open the file
Paste in the code from Pho's post
Save
Double-click file to run it.
 
Aww, beaten to it by Pho. Though I was going to suggest PowerShell! :D


Powershell is on my list of things to learn. I like the pretty blue screen :D.



If you use:

Code:
@ECHO OFF
FOR /f "tokens=1-2 delims=." %%A IN ('dir /b *.avi') DO (
	mkdir "%%A"
	move "%%A.%%B" "%%A"
)
pause

You should be able to see any error messages without the window closing. I'm on Windows 7 x64 too and it works.
 
It should work fine running on different drives.. here's a before and after running from drive d:


djm4I.png
 
the files are not on my c drive Internal Hard Drives f. is there another way off doing it like free software . cheers

The script doesn't care what drive it is run from. As long as it is in the same folder as your .avi files. Are you sure they are .avi? Like Pho said, if they're not .avi, change it to .divx, .xvid, .mkv, .wmv or whatever video file type they are.

Can we see a screenshot of the folder you are trying to organize?
 
Back
Top Bottom