ExifTool Forum

ExifTool => The "exiftool" Application => Topic started by: Danika Li on July 09, 2021, 08:51:24 AM

Title: Correct use of Get-ChildItem in Windows PowerShell for files bulk processing
Post by: Danika Li on July 09, 2021, 08:51:24 AM
Hello! I'm trying to use PowerShell to bulk process PDF documents using ExifTool, and I'm not very good at it. More precisely, it doesn't work at all.

Get-ChildItem -Recurse -Include *.pdf -Name | <path to app>\exiftool.exe -s

(Current folder - folder with documents.) Shouldn't this command list PDFs in the specified folder in relative path format, and pass it to ExifTool to display all the metadata? If the specified (and similar) action cannot be performed without knowledge of scripts, then maybe it is possible to do it in the old Windows console (cmd.com - with MS-DOS commands)?

exiftool 12.2.8.0
Microsoft Windows 10.0.19043.1083
Windows Terminal Preview 1.9.1523.0
Title: Re: Correct use of Get-ChildItem in Windows PowerShell for files bulk processing
Post by: Phil Harvey on July 09, 2021, 10:53:21 AM
You can use exiftool to find the PDF's:

exiftool -ext pdf -r DIR

- Phil
Title: Re: Correct use of Get-ChildItem in Windows PowerShell for files bulk processing
Post by: Danika Li on July 09, 2021, 12:05:22 PM
Quote from: Phil Harvey on July 09, 2021, 10:53:21 AMexiftool -ext pdf -r DIR

<folder containing document folders>>exiftool.exe -ext pdf -r DIR -charset filename="" -Author<="<path>\Автор.txt" -overwrite_original
Error: File not found - DIR. You were meant to enter any valid directory name, not "DIR" literally.

exiftool.exe -ext pdf -r DIR "<path>" -charset filename="" -Author<="<path>\Автор.txt" -overwrite_original
Error: File not found - DIR
You were meant to enter any valid directory name, not "DIR" literally.
Warning: [minor] Ignored empty rdf:Seq list for dc:creator - <path>/FileName.pdf
Warning: [minor] Ignored empty rdf:Seq list for dc:creator - <path>/FileName.pdf
3 directories scanned
3 image files updated

exiftool.exe -charset filename="" -ext pdf -r DIR "<path>" -City<="<path>\City.txt" -overwrite_original
Error: File not found - DIR
You were meant to enter any valid directory name, not "DIR" literally.
3 directories scanned
3 image files updated


Thank you! In the second and third cases, the tags are correctly entered into the documents. But what do the warnings mean?
Title: Re: Correct use of Get-ChildItem in Windows PowerShell for files bulk processing
Post by: Phil Harvey on July 09, 2021, 12:08:50 PM
All the clues are there.

Read my signature and pay attention to this message:

You were meant to enter any valid directory name, not "DIR" literally.

- Phil
Title: Re: Correct use of Get-ChildItem in Windows PowerShell for files bulk processing
Post by: Danika Li on July 09, 2021, 02:26:01 PM
Quote from: Phil Harvey on July 09, 2021, 12:08:50 PMdirectory name, not "DIR" literally.
Thank you again! I had disabled the display of signatures, and I did not know that it is customary on this forum to post useful information in them. It's Friday night, it's hot, and I'm slowing down in obvious things. I beg your pardon for my lack of understanding. Yes,

exiftool.exe -charset filename="" -ext pdf -r "<path>" -City<="<path>\FileName.txt" -overwrite_original

command works as it should. This is much better than my 8MB .cmd file with 20,000+ commands that I glued together in Excel.
Title: Re: Correct use of Get-ChildItem in Windows PowerShell for files bulk processing
Post by: Phil Harvey on July 09, 2021, 02:34:38 PM
Quote from: Danika Li on July 09, 2021, 02:26:01 PM
I had disabled the display of signatures,

I didn't know you could do that.  :P

- Phil