Jump to content
Main menu
Main menu
move to sidebar
hide
Navigation
Main page
Recent changes
Random page
freem
Search
Search
Appearance
Create account
Log in
Personal tools
Create account
Log in
Pages for logged out editors
learn more
Contributions
Talk
Editing
Openai/6910af03-f58c-800b-a67e-c1aff06d11d4
(section)
Add languages
Page
Discussion
English
Read
Edit
Edit source
View history
Tools
Tools
move to sidebar
hide
Actions
Read
Edit
Edit source
View history
General
What links here
Related changes
Special pages
Page information
Appearance
move to sidebar
hide
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
=== Assistant: Got it β thanks for the clarification. === Got it β thanks for the clarification. Below is a single-line PowerShell command you can paste into the folder. It will: * Look for files with Snapchat- in the name. * Try several shell/EXIF properties in this order: System.Photo.DateTaken, Date, Content created, System.DateCreated, System.FileSystem.DateCreated, System.ItemDate, System.DateModified. * If none of those are present, it falls back to the file system CreationTime. * Renames Snapchat- β IMG_<YYYYMMDD>_ and keeps the rest of the name. One-liner (paste as-is): <syntaxhighlight lang="powershell">Get-ChildItem -File | Where-Object { $_.Name -like '''Snapchat-''' } | ForEach-Object { $dt=$null; try { $sh=New-Object -ComObject Shell.Application; $f=$sh.Namespace($_.DirectoryName); $i=$f.ParseName($_.Name); $props=@("System.Photo.DateTaken","Date","Content created","System.DateCreated","System.FileSystem.DateCreated","System.ItemDate","System.DateModified"); foreach($p in $props){ if(-not $dt){ $v=$null; try{ $v=$i.ExtendedProperty($p) } catch{}; if($v -and $v -ne ''){ if($v -is [datetime]){ $dt=$v } else { try{ $dt=[datetime]::Parse($v) } catch{} } } } } } catch{}; if(-not $dt){ $dt=$_.CreationTime }; $datestr=$dt.ToString('yyyyMMdd'); $newName = $_.Name -replace 'Snapchat-', "IMG_${datestr}_"; Rename-Item -LiteralPath $_.FullName -NewName $newName } </syntaxhighlight> Notes * If you want to process subfolders, add -Recurse to Get-ChildItem. * CreationTime is used as the final fallback (this is the typical "Content created" filesystem value). If you prefer LastWriteTime instead, I can switch the fallback. * If any file still doesn't pick up the expected date, paste one example filename (and show dir /T:C "filename.jpg" output if possible) and Iβll diagnose why that file lacked the metadata property. Want me to return a version that runs recursively and logs original β new names to a CSV?
Summary:
Please note that all contributions to freem are considered to be released under the Creative Commons Attribution-ShareAlike 4.0 (see
Freem:Copyrights
for details). If you do not want your writing to be edited mercilessly and redistributed at will, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource.
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)