Work efficiency and automation (file name fixes and more)

Introduction
Hello everyone,
this article is about working in an efficient way to save time.
This is more important for artists who create a lot of images on a daily base, who want to save time and who care about proper file naming (e.g. for the purpose of archiving).
On a technical note, the following tools / techniques are used:
Windows Powershell
Regular Expressions
Microsoft PowerToys (user friendly)
If you have a use case and need a fix / automation for it, then please let me know!
Scenario 1: Rename many files at once
Assume that you have 20 images in a Windows Explorer folder and you want a proper name for each of them.
Steps (rename files with increasing number)
In the address line of the Windows Explorer, click in it, type in cmd and press <Enter>. It will open the Windows command shell and the start point is already that specific folder with the images.
Copy this line (replace XX with the name that you prefer):
powershell -NoProfile -Command "$i=1; Get-ChildItem -File | Sort-Object Name | ForEach-Object { Rename-Item -LiteralPath $_.FullName -NewName ('XX' + $i++ + $_.Extension) }"
Paste it into the Windows command shell with a right mouse click.
Press <Enter> to execute the command.
Results (rename files with increasing number)
Renames all files in the current folder.
Numbers increase automatically.
Keeps the original file extensions.
Each filename is unique.
Does not touch subfolders.
Example: XX1.png, XX2.jpg, XX3.png, XX4.mp4, XX5.webp
Scenario 2: Trim many file names at once
Assume that you have 20 images in a Windows Explorer folder and you want to remove certain strings in each of them.
Steps (trim file names)
In the address line of the Windows Explorer, click in it, type in cmd and press <Enter>. It will open the Windows command shell and the start point is already that specific folder with the images.
Copy this line (adapt as needed; see results below):
powershell -NoProfile -Command "Get-ChildItem -File | Where-Object { $_.BaseName -match '3K' } | Rename-Item -NewName { (($_.BaseName -replace '_US1','') -replace '3K.*$','3K') + $_.Extension }"
Paste it into the Windows command shell with a right mouse click.
Press <Enter> to execute the command.
Results (trim file names)
Removes all occurrences of the string _US1
Removes everything after the string 3K
Keeps the original file extension.
Processes all matching files in the current folder.
It does not process subfolders.
Scenario 3: Rename many files at once with PowerToys
Requirement: https://learn.microsoft.com/en-us/windows/powertoys/
Documentation: https://learn.microsoft.com/en-us/windows/powertoys/powerrename
Select the files you want to rename,
Mouse button right click,
Select "Rename with PowerRename",
Follow the instructions in the new window.
Scenario 4: Resize images without quality loss with PowerToys
Requirement: https://learn.microsoft.com/en-us/windows/powertoys/
Documentation: https://learn.microsoft.com/en-us/windows/powertoys/image-resizer
Goal: Reduce file size by up to 90% without quality loss (e.g. from 30MB to 3MB).
Select the files you want to resize,
Mouse button right click,
Select "Resize with Image Resizer",
In the new window, select "Large".
Result: file size is up to 90% smaller with barely any quality loss!
Optional: You can customize which size you want if "Large" does not fit your goals, e.g. 4K with 3840 x 2160.
Thanks for reading!
If you have made it this far, thanks for reading! Please follow for more and leave a like if you liked it.
If you have questions, then please let me know.
Good luck and have fun! 🫶