Тёмный

How to rename multiple photos to the date (Windows) 

Karina Adcock
Подписаться 47 тыс.
Просмотров 24 тыс.
50% 1

Опубликовано:

 

20 окт 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 76   
@karinaadcock
@karinaadcock Год назад
If you have more than one file with the same date and time use this code: Get-ChildItem | ForEach{ $number = 1 $folderpath = $_.DirectoryName $DateTaken = $_.LastWriteTime.ToString("yyyy-MM-dd HH.mm") $newpath = $folderpath + "\" + $DateTaken + "_" + $number + $_.Extension while ((Test-Path -Path $newpath) -eq $true) {$newpath = Join-Path $folderpath($DateTaken + "_" + $number + $_.Extension) $number+=1} Rename-Item $_.pspath -NewName $newpath}
@avforums
@avforums Год назад
Coming from coding on DOS before Windows, I never even knew that Windows PowerShell existed, and so it was very useful to find your video to rename a bunch of files to their modified date. Thanks so much for sharing this.
@tapeton
@tapeton 2 года назад
You are an absolute hero! I have like 4 thousand photos that my iphone insists in export like a mishmash of letters and symbols, this is exactly what I was looking for, thank you!
@ddsquires
@ddsquires Год назад
THANK YOU! To anyone wondering where the PowerShell option is in the menu... "Open in Terminal" is the same thing. 😅
@mihai-19
@mihai-19 Год назад
Simply clear, wonderful presentation. So it can be done without the stupid background music and/or confusing shortcuts. Thank you.
@720zone
@720zone Год назад
MAKE A BACKUP BEFORE YOU MESS WITH THIS!!! Completely screwed myself trying this. Renamed all of my folders in a directory and could not get them back. Total nightmare!!! I'm so bummed.
@Weigazod
@Weigazod Год назад
Thank you! I was one of those guys who have to see someone did something to know how to do it. Thanks for the demonstration! Have a great day!
@kenastroswazzuro848
@kenastroswazzuro848 6 месяцев назад
Clear, concise -exactly what I needed! 👍🙂A great instructional video! 👍Works a treat! Thank You!🙂👌🤩
@Blessing_or_Curse
@Blessing_or_Curse 3 года назад
This is awesome!! What would the code be to use the Date Taken instead of the "LastWriteTime" ?
@Novau.u
@Novau.u Год назад
Wow this was so helpful, right near the end i was like I need to put a name at the front how do i do that? Then you just go to explain it perfect tutorial!!!!!! saved me so much time!
@ddsquires
@ddsquires Год назад
To anyone asking "What if I have multiple of the same photo modified at the same time and date?" ie including the same seconds: Use the "Holiday" example at the end of Karina's video to append another value to the subset of files that became the duplicate timestamp. First temporarily put those files in a folder of their own and run the PowerShell/Terminal again. For me to match how my phone names these files, it involved adding "(O)" instead of "-Holiday". Then copy all the renamed files to your desired folder.
@simonlaugesen1012
@simonlaugesen1012 9 месяцев назад
easyer to include filelength (size) if datetime and size match to the last byte you are pretty sure you have a duplication
@jimmylewis6070
@jimmylewis6070 Год назад
WOW! Thanks Karina for this awesome tool for renaming muliple files. Great to use to change the names of trailcam videos to a readable time line while viewing.👍
@MrBlueSkeyes
@MrBlueSkeyes 8 месяцев назад
I use VLC Scene filter. This works great to rename the sequential files. Now I can stop VLC, Rename files, and re-start VLC and not worry about earlier files being overwritten.
@tama9k920
@tama9k920 5 месяцев назад
Thank you so much for your detail guide. It helps me a lot. Hope you can release more videos like this
@lorisf9547
@lorisf9547 10 месяцев назад
Thanks for the great video. You saved me so much time - There was a time where I renamed my files manually, lol. I wish I had found this video earlier. Thanks so much!
@maxwang2537
@maxwang2537 2 года назад
This is very useful. Thanks. One question - how to get the time taken for photos with $_?
@tulsadlance
@tulsadlance 2 года назад
This is exactly what I needed tonight. Thank you!
@MsBeastShortsLive
@MsBeastShortsLive 2 года назад
So very useful! I was trying to do it one by one 😂 Thank you!
@erezazogu7072
@erezazogu7072 9 месяцев назад
Why does it work for some photos but not others? Even though all of them have a date modified information?
@teddygonzalez87
@teddygonzalez87 Год назад
Hi Karina I have the following problem: Some of my photos have the same date and time AND they don't have the 'date taken' value, therefore your code from the other video doesn't work. Is there a way to change the code so it only takes into account 'LastWriteTime' and not 'DateTaken'?
@karinaadcock
@karinaadcock Год назад
I edited the code from the other video so that it will work with the LastWriteTime: Get-ChildItem | ForEach{ $number = 1 $folderpath = $_.DirectoryName $DateTaken = $_.LastWriteTime.ToString("yyyy-MM-dd HH.mm") $newpath = $folderpath + "\" + $DateTaken + "_" + $number + ".jpg" If(Test-Path -Path $newpath){ while ((Test-Path -Path $newpath) -eq $true) {$newpath = Join-Path $folderpath ($DateTaken + "_" + $number + $_.Extension) $number+=1} Rename-Item $_.pspath -NewName $newpath } else { Rename-Item $_.pspath -NewName $newpath }}
@peterparker1738
@peterparker1738 8 месяцев назад
Brilliant! But what if I want to KEEP the filename as it is and just put the Date IN THE BEGINNING of the filename ... ?
@peterparker1738
@peterparker1738 8 месяцев назад
forget it... chatGPT gave me answer already .... we live in awesome times
@michelemengascini
@michelemengascini 2 года назад
Hi, i get an error like that: "rename : term 'rename' not recognized as a cmdlet name", i'm on powershell with admin privilege
@isded
@isded Год назад
perfect, straight to the point, thanks
@kelennihomori8006
@kelennihomori8006 2 года назад
Hi, do you know how to rename file titles(on file property > details) ? I cant edit those on videos.
@trebilicious
@trebilicious 3 года назад
This is so useful! Thank you!
@Chris.Mechanic
@Chris.Mechanic Год назад
Extremly helpful! Thank you!
@craigv7062
@craigv7062 2 года назад
That was a great help. Thank you!
@mfede598
@mfede598 8 месяцев назад
Hello, how could i use 24 hour instead of am/pm ? Now when i rename a photo that was taken at 16:10 it renames with 04.10... Thank you !
@MrBlueSkeyes
@MrBlueSkeyes 8 месяцев назад
Use HH instead of hh to get 24 hour time.
@mfede598
@mfede598 8 месяцев назад
@@MrBlueSkeyes thank you!
@despressod
@despressod 3 года назад
this helped me so much thank you
@BentleyGolf2013
@BentleyGolf2013 Год назад
What if I have multiple of the same photo modified at the same time and date? How would I fix that?
@karinaadcock
@karinaadcock Год назад
I have another video showing a different method for doing this that you could try. ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-UKvkPnbQqwI.html This would be the code for if you have multiple files with the same date and time. $shell = New-Object -ComObject shell.application $ukCulture = [Globalization.CultureInfo]'en-GB' Get-ChildItem | ForEach{ $folderpath = $_.DirectoryName $folder = $shell.NameSpace($_.DirectoryName) $RawDate = ($folder.GetDetailsOf($folder.ParseName($_.Name),12) -Replace "[^\w /:]") $datetime = [DateTime]::Parse($RawDate,$ukCulture) $DateTaken = $datetime.ToString("yyyy-MM-dd HH.mm ") $number = 1 $newpath = $folderpath + "\" + $DateTaken + "_" + $number + ".jpg" If(Test-Path -Path $newpath){ while ((Test-Path -Path $newpath) -eq $true) {$newpath = Join-Path $folderpath ($DateTaken + "_" + $number + $_.Extension) $number+=1} Rename-Item $_.pspath -NewName $newpath} else {Rename-Item $_.pspath -NewName $newpath} }
@ddsquires
@ddsquires Год назад
Hi did you figure this out yet? I just had the same situation and found this to work. If you want to use the same method in this video you could also do the following (the method Karina mentions in her reply here is more intimidating to me!): Use the "Holiday" example at the end of Karina's video to append another value to the subset of files that became the duplicate timestamp. First temporarily put those files in a folder of their own and run the PowerShell/Terminal again. For me to match how my phone names these files, it involved adding "(O)" instead of "-Holiday". Then copy all the renamed files to your desired folder.
@BentleyGolf2013
@BentleyGolf2013 Год назад
@@ddsquires I honestly just used chatGPT lol
@brittneespindler881
@brittneespindler881 Год назад
Could you please provide the Code for if you have multiple files with the same last write date and time? - thank you
@ddsquires
@ddsquires Год назад
Hi did you figure this out yet? I just had the same situation and found this to work. Use the "Holiday" example at the end of Karina's video to append another value to the subset of files that became the duplicate timestamp. First temporarily put those files in a folder of their own and run the PowerShell/Terminal again. For me to match how my phone names these files, it involved adding "(O)" instead of "-Holiday". Then copy all the renamed files to your desired folder.
@godlytjoseph
@godlytjoseph 2 года назад
Can you please tell how to add 'created date' as a file name instead of the 'modified date'?
@karinaadcock
@karinaadcock 2 года назад
Change file name to the date taken: ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-UKvkPnbQqwI.html
@rawafuad
@rawafuad Год назад
Appreciate what you doing and kindly I'm asking for Code if you have multiple files with the same date and time please
@karinaadcock
@karinaadcock 2 года назад
To do this using the date taken instead of the last write time: ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-UKvkPnbQqwI.html
@jamesdubben3687
@jamesdubben3687 Год назад
Oh, this looks promising, my LastWriteTime dates are all the same. Off to new link.
@rawafuad
@rawafuad Год назад
@@jamesdubben3687 I have the same problem in different way more than one pic at one time
@UNBEK4NNTE
@UNBEK4NNTE Год назад
How do I do this, but with "Date created"???
@karinaadcock
@karinaadcock Год назад
Try this method: ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-UKvkPnbQqwI.html
@Hitman51685
@Hitman51685 2 года назад
You rock. Thank you!
@vidilogs9382
@vidilogs9382 2 года назад
What to do if files have same date and time... It shows error on that case
@karinaadcock
@karinaadcock 2 года назад
You could use code like this: $shell = New-Object -ComObject shell.application $ukCulture = [Globalization.CultureInfo]'en-GB' Get-ChildItem | ForEach{ $folderpath = $_.DirectoryName $folder = $shell.NameSpace($_.DirectoryName) $RawDate = ($folder.GetDetailsOf($folder.ParseName($_.Name),12) -Replace "[^\w /:]") $datetime = [DateTime]::Parse($RawDate,$ukCulture) $DateTaken = $datetime.ToString("yyyy-MM-dd HH.mm") $number = 1 $newpath = $folderpath + "\" + $DateTaken + "_" + $number + ".jpg" If(Test-Path -Path $newpath){ while ((Test-Path -Path $newpath) -eq $true) {$newpath = Join-Path $folderpath ($DateTaken + "_" + $number + $_.Extension) $number+=1} Rename-Item $_.pspath -NewName $newpath} else {Rename-Item $_.pspath -NewName $newpath} } See video for more information: ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-UKvkPnbQqwI.html
@martinlamotte3912
@martinlamotte3912 2 года назад
@@karinaadcock Im not a programmer but used your scripting it s very useful and u r a good teacher :) but as i faced exactly same problem than Vi Di Logs, i tested ur solution which give me Exception lors de l'appel de «Parse» avec «2» argument(s): «La chaîne n'a pas été reconnue en tant que DateTime valide. » Au caractère Ligne:5 : 1 + $datetime = [DateTime]::Parse($RawDate,$ukCulture) + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : NotSpecified: (:) [], MethodInvocationException + FullyQualifiedErrorId : FormatException
@martinlamotte3912
@martinlamotte3912 2 года назад
oh it do that error, but it looks like it works in fact it just removed last millisec replacing by 1 2 etc
@martinlamotte3912
@martinlamotte3912 2 года назад
May I ask you please how add recursiv function to this ? So it go in all sub folders
@karinaadcock
@karinaadcock 2 года назад
@@martinlamotte3912 As your error is in French I'm guessing you are in France. So in the second line you should change [Globalization.CultureInfo]'en-GB' to [Globalization.CultureInfo]'fr-FR' I think the date format might be the same in France and England so you are getting an error but its still working.
@monkeycrunchie
@monkeycrunchie 2 года назад
Thanks! Big help.
@michnick8
@michnick8 2 года назад
Waiting for more;)
@EdgarAllenHoopoe
@EdgarAllenHoopoe 2 года назад
Thank you sooooo much for this. I have one question: What's the command for renaming by date/time modified but keeping the original name on the end? Is that possible? I'm currently using Get-ChildItem | Rename-Item -NewName {$_.LastWriteTime.ToString("yyyy-MM-dd HH.mm.ss") + ($_.Extension)} and it's been working great. I'd just like to keep the original file number as well.
@karinaadcock
@karinaadcock 2 года назад
If you want to keep the original file name then you need: $_.basename Combined with everything else: Get-ChildItem | Rename-Item -NewName {$_.LastWriteTime.ToString("yyyy-MM-dd HH.mm") + $_.basename + $_.Extension} You probably also what a space or something separating the name and the date so: Get-ChildItem | Rename-Item -NewName {$_.LastWriteTime.ToString("yyyy-MM-dd HH.mm") + " " + $_.basename + $_.Extension}
@shankarbanti2250
@shankarbanti2250 3 года назад
Thanks Maim u r Great 👍👍👍
@danielchen1813
@danielchen1813 Месяц назад
👍👍
@RamkumarPanjanathan
@RamkumarPanjanathan 2 года назад
Very Much Useful this is Awesome Hope it will save lot of time while uploading cine actress pics to my website. Thanks a lot dear
@rozpovidnycia
@rozpovidnycia 2 месяца назад
THANK YOU
@martinlamotte3912
@martinlamotte3912 2 года назад
U rock
@moiseasta9785
@moiseasta9785 Год назад
Not working
@MrBlueSkeyes
@MrBlueSkeyes 8 месяцев назад
Don't give up.
@majedmj.digitalworlds
@majedmj.digitalworlds 2 года назад
big thanks
@majedmj.digitalworlds
@majedmj.digitalworlds 2 года назад
question : How to add also length? to be like this "2020-Aug-01 07.01 - 00:02:00.MP4"
@karinaadcock
@karinaadcock 2 года назад
This code should add the length to the end of the file name: $shell = New-Object -ComObject shell.application Get-ChildItem | ForEach{ $folder = $shell.NameSpace($_.DirectoryName) $length = ($folder.GetDetailsOf($folder.ParseName($_.Name),27) -Replace ":", ".") Rename-Item $_.FullName ($_.Basename + " - " + $length + $_.Extension)} I made another video about dates in powershell which explains some of this code: ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-UKvkPnbQqwI.html
@gella9023
@gella9023 2 года назад
Hello Karina Thanks for your great RU-vid Chanel. Since a long time I rename 5 times a Week 14 Screenshoots per day (14 * 5 * 50 = 3500 a year) Now I'm looking for a solution to rename "Screenshot_20220504-160252.png" to "Screenshot_2022-05-04-16-02-52.png" The "_" already exists in the name. I didn't found any usefull staff to change these names. Do you have any solution? Thanks
@karinaadcock
@karinaadcock 2 года назад
You could try using the method in this video ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-znhqGrF4gVQ.html
@karinaadcock
@karinaadcock 2 года назад
This code should work. In the substring the first number is the index i.e. position of the number and the second number is the length i.e. the number of digits you want to include. Get-ChildItem | Rename-Item -NewName { $_.Name.Substring(0,15) + '-' + $_.Name.Substring(15,2) + '-' + $_.Name.Substring(17,5) + '-' + $_.Name.Substring(22,2) + '-' + $_.Name.Substring(24)}
@gella9023
@gella9023 2 года назад
@@karinaadcock Hello Karina Thanks for your answer. I tried it and it works. It seems like, that this code treatens the file name as a text and not as a date. So I googled all the time with the wrong parameters (Change date format) Thanks once again. Gella
Далее
How to rename photos to the date taken
17:10
Просмотров 26 тыс.
How to rename multiple files in Windows
14:10
Просмотров 125 тыс.
Уловки Такси: не ведись!
0:43
Просмотров 285 тыс.
This Simple File Management System Changed My Life!
9:27
8 Hidden Windows Tools That You Probably Didn't Know
7:57
How Fast Can I Fill My Inbox?
13:30
Просмотров 354 тыс.
Was Windows Vista THAT bad?
12:55
Просмотров 6 млн
How to Rename Multiple files on Mac.
9:46
Просмотров 24 тыс.
Уловки Такси: не ведись!
0:43
Просмотров 285 тыс.