What you need to do is take a FOR command and process the output of a DIR command. You'll probably have to nest two FOR commands to get the individual numbers of the date.
Suggested DIR command to use:
dir c:\ /TC /A-D
Suggested FOR command:
FOR /F " TOKENS=1,5 delims= " %A IN ('dir c:\ /TC /A-D') DO @ECHO A-%A B-%B
This should give you mostly what you need in order to get this to work. The problem is that CMD is terrible at this kind of work. While you can do it, I would recommend that you use a more advanced language like powershell. It's free for windows and Quest Software makes a great GUI editor called powerGUI.
Here is what I wrote in Powershell to do this. It's a lot easier for me to follow.
#Get files in C:\temp and filter out directories
$tarfol = "C:\temp" #Target Folder
$var = Get-ChildItem $tarfol | Where-Object {$_.mode -inotmatch "d"}
#Process Files
foreach($item in $var)
{
#Build New Folder Path
$folder = "$tarfol\$item.CreationTime.Year\$item.CreationTime.Month\$item.CreationTime.Day"
#Test for for folder
if(!(Test-Path $folder)) {
#Create folder
New-Item -Path C:\temp\$y\$m\$d -ItemType directory
}
#Move item
Move-Item -Path $item.FullName -Destination "$folder"
}
Hope this helps.