Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I want to set the title of image files (view Properties - tab Details - Title textbox) to be their filenames by running a command from command line. How can I do this?

share|improve this question
up vote 2 down vote accepted

Install ExifTool for Windows to somewhere in your PATH and rename it to exiftools.exe

Then you can use the following command to update the Title field for each JPG file in the current directory:

for %i in (*.jpg) do @exiftool -Title="%~ni" %i

By default, exiftool seems to create copies of the originals with the extension .jpg_original before modifying them.

share|improve this answer
When I run your command I get the error ~ni" i was unexpected at this time. Please help. – Nam G VU Jun 9 '10 at 10:54
Are you trying to do this in a .bat file or .cmd file? If so, you will need to use %%i instead of %i and %%~ni instead of %~ni. Also, you will need to make sure you have Command Extensions enabled when using cmd.exe – Mike Fitzpatrick Jun 9 '10 at 11:03
I run the script by .bat file. I replace %i to %%i and %~ni to %%~ni and it works. Thank you. – Nam G VU Jun 10 '10 at 3:53

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.