I have a bunch of files in a folder and I would like to add a prefix to their names. E.g. there are image files named like dsc0001.jpg dsc0002.jpg etc., and I want to rename them like 20081215dsc0001.jpg 20081215dsc0002.jpg I know an easy way to do this in mc under Linux, but I would like to learn it in Windows, too. Can you help me?
ren * 20081215*
Use Total Commander. Inside Total Commander select the files you want to rename (using right mouse or invert selection) Then: File->Multi-Rename Tool
In the Rename mask: file name textbox enter: [YMD]-[hms]-[N]-yourname
This way you can combine photos of multiple users. Good luck, Peter
Windows has built in functionality for stuff like this.
Select all the files, rename one to 2005-11-09DSC then windows will rename them all ..DSC(0001) ..DSC(0002) etc.
I think thats what you're looking for.. if not then sorry
If you want to use todays date, try making a batch file like this:
set d=%date% set ff=%d:~0,4%%d:~5,2%%d:~8,2% for %%i in (dsc*.jpg) do ren %%i %ff%%%i set d= set ff=
It will used today's date to construct a string like 20071216 and prepend it to the file name.
C:\Users\mateer\Desktop\custom-path>type prepend.bat @echo off for /f "usebackq delims=" %%i in (`dir /b`) do @move "%%i" "%* %%i"
From the replies above, I'd hazard a guess and suggest that a new version of explorer wouldn't do half-bad if it implemented a nice multiple-file-renaming GUI.
System.IO and maybe regulaur expressions. Although I could see how this isnt a suggestion for a non dev. I am sure by being on here you can write a simple console project.
System.IO and maybe regulaur expressions. Although I could see how this isnt a suggestion for a non dev. I am sure by being on here you can right a simple console project.
Um, that's really over-complicating things. Not only is it a single DOS command, but it's pretty much
the textbook example for "Why DOS globbing is superior to *nix"
Complicated ? less than 5 lines of code. More control. And I didn't have to use/learn/groke yet another syntax. The code is self explanatory.
To me: set d=%date% set ff=%d:~0,4%%d:~5,2%%d:~8,2% for %%i in (dsc*.jpg) do ren %%i %ff%%%i set d= set ff=
Is pretty much garbage.
The problem with the file system and other ways mentioned, is that pictures have meta data which stores the 'date photo taken' - and it is not always the date modified (if you removed redeye or something beforehand).
I had to write a tool which loads the date modified so that I can sort the stuff and do a basic filter (text with a # which inserts the numbers for the selection). I've never seen another tool out there which does it, and it's pretty easy to make. I'd suggest
going that route if you have a lot of photos and really want the date to be accurate.
Comments have been closed since this content was published more than 30 days ago, but if you'd like to continue the conversation, please create a new thread in our Forums, or Contact Us and let us know.