In PS something simple like this works.
param(
[string] $targetPath
)
# Assuming the script is run in the current directory
if (-Not $targetPath) {
$targetPath = Get-Location
}
# Get the files
Get-ChildItem $targetPath -File | Rename-Item -NewName { "$($_.CreationTime.ToString('yy MM dd')) $($_.Name)" }
If you put the script in the same directory as the files to be renamed then you can just run the script directly. Otherwise specify -targetPath ...
to specify the target directory to rename. If you want to recursively rename subfolder files then add -recurse
to the Get-ChildItem
call.