To use one of the already created answers in PowerShell
<#
File modified by Joshua as taken from
http://www.marcvalk.net/2012/06/powershell-moving-files-into-subfolder-based-on-date/
Set Variables of Source folder and Destination folder
Assign variable of files to be the files with uss extension
For each file with uss extension assign the Directory variable the information for file creation year and month
if the year and month folder do not exist, then create them from file creation information
Move file to sub-folder of year and month from file creation information passed into Directory variable
#>
$SourceDir = "C:\<Pointer>"
$DestinationDir = "C:\<Pointer>"
$files = get-childitem $SourceDir
foreach ($file in $files)
{
$Directory = $DestinationDir + "" + $file.CreationTime.Date.ToString('yyyy') + "\" + $file.CreationTime.Date.ToString('MM-MMM') + "\" + $file.CreationTime.Date.ToString('DD')
if (!(Test-Path $Directory))
{
New-Item $directory -type directory
}
Move-Item $file.fullname $Directory
}
do note that you'll need to point to your folder before hand, basically when you're in type "cd c:\" with the pointer being where the folder is
Make sure to edit $SourceDir = "C:\<Pointer>"
and $DestinationDir = "C:\<Pointer>"
as needed
The other option is this
$Folder = "C:\<pointer>"
get-childitem | % {
$file = $_.FullName
$date = Get-Date ($_.CreationTime)
$hour = $date.Hour
$day = $date.day
$month = $date.month
$year = $date.year
new-item -type Directory -path "$Folder\$year\$month\$day\$hour"
move-item $file "$Folder\$year\$month\$day\$hour"
}
However, all these solutions require you to run the script at the time you want to log your files.