command works in cmd but not in a batch

Started by Positiv79, February 14, 2021, 02:21:03 PM

Previous topic - Next topic

Positiv79

Can someone give me a hint for the following problem:

When I write this into cmd (windows):
exiftool "-FileName<CreateDate" -d "%Y%m%d_%H%M%S.%%e"  C:\Test
The tool changes the namings of the files inside the folder Test as expected.

When I have exactly the same line in a batch file (test.bat) it does not work.
The cmd tells me
"Warning: New file name is empty ..." //for every file
"1 directories scanned"
"0 image files updated"
"6 image files unchanged" //because of 6 test images in the Test folder

What I do wrong? Do I use the batch file in a wrong way?

StarGeek

"It didn't work" isn't helpful. What was the exact command used and the output.
Read FAQ #3 and use that cmd
Please use the Code button for exiftool output

Please include your OS/Exiftool version/filetype

Positiv79

Ah, yes, thank you.

So for the batch I have to change the example to:
exiftool "-FileName<CreateDate" -d "%%Y%%m%%d_%%H%%M%%S.%%%%e"  C:\Test

It works!!