ExifTool Forum

ExifTool => Developers => Topic started by: Positiv79 on February 14, 2021, 02:21:03 PM

Title: command works in cmd but not in a batch
Post by: Positiv79 on February 14, 2021, 02:21:03 PM
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?
Title: Re: command works in cmd but not in a batch
Post by: StarGeek on February 14, 2021, 03:04:27 PM
See FAQ #27 (https://exiftool.org/faq.html#Q27)
Title: Re: command works in cmd but not in a batch
Post by: Positiv79 on February 15, 2021, 10:28:07 AM
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!!