can -@ <file> be stdin in windows

Started by Archive, May 12, 2010, 08:54:31 AM

Previous topic - Next topic

Archive

[Originally posted by mis42n on 2009-02-14 11:12:08-08]

I am running ExifTool to insert fields using a windows vbscript by:

Code:
Set WshShell = CreateObject("WScript.Shell")
Set oExec    = WshShell.Exec("exiftool ""<input file>"" -o ""<output file>"" -@ <argfile>")

[which is just like typing this at a command prompt except the "" are converted to " by vbscript]
I'm using the <argfile> so I don't have to think about misinterpretation by the DOS shell (I think it was called 'shell globbing' in the documentation.

It would be more elegant if I could feed the argfile lines into the stdin of the shell running ExifTool (something like '-@ stdin') to save creating and deleting temporary files all the time.  Is there some variant of -@ which does this?

If there isn't an option, it is not a problem.  The existing (inelegant) method works just fine.  ExifTool has saved me one heap of work. I had started writing the code to pull jpgs apart and put them together but in vbscript it is very sssslllooooowww, and dealing with latitude/longitude, and some of the other fields, was a PITA.  Long live ExifTool.

Archive

[Originally posted by exiftool on 2009-02-14 15:28:05-08]

Very odd idea, but you can use -@ with stdin
by using "-@ -".

- Phil

Archive

[Originally posted by mis42n on 2009-02-14 21:17:21-08]

Thanks for that, I shall give it a try when I get to work on Monday.  Is there anything that ExifTool can't do:)

There are some who say using windows is very odd, and using vbscript is even odder.  But I use the tools I have.  The Windows Scripting Host is on every Windows system since 2000, and I think was available for download before then.  I used QBASIC before that, so that was my choice.

I've been out of programming for more than 10 years, so it's been a steep learning curve.  If I knew 3 months ago what I know now I would have used jscript instead.  I'm using IE as a visual front end, and that's the preferred browser script. But I would still have run into the same problem, need to run ExifTool as a shelled process, and stdin is the logical way to feed it.  Might not make sense in other environments.

Archive

[Originally posted by mis42n on 2009-02-16 05:51:28-08]

Phil,

Works just fine. Thanks. I wondered how come you had catered for it even though it was 'very odd'.  Searched the perl documentation, found the bit that says - is stdin.  Lightbulb.  Hindsight is a great teacher.

Cheers - Alan