Windows path character in $Directory incorrect (Unix style, not Windows style)

Started by HiTechHiTouch, August 03, 2012, 06:55:45 PM

Previous topic - Next topic

HiTechHiTouch

I'm running the Windows Install package https://exiftool.org/exiftool-8.98.zip,

I want Exiftool to generate a command file to update the file system create date.  I went this route, instead of using ExifTool directly, because of the warning in "Extra Tags" about the problems of setting a file create date (as opposed to a modified date).

I'm running in a Windows command (console) window.  I am using TTC/LE, a cmd.exe compatible shell because I couldn't seem to get quotes and per-cents correctly parsed correctly by cmd.exe, and because it has a TOUCH command. 

Here's the shell listing (ExifTool command line may be split in two by viewing):


[F:\]ver
TCC LE  13.04.63   Windows XP [Version 5.1.2600]
[F:\]exiftool.exe -ver
8.98
[F:\]exiftool -q -T -d `"/Dc%m/%d/%Y /Tc%H:%M:%S"` -f -p "touch $DateTimeOriginal \"$Directory/$FileName\"  " -ext jpg -fast2 -if "$exif:DateTimeOriginal"  .
touch /Dc05/13/2012 /Tc13:30:19  "./DSC02380.JPG"


-- The back quotes protect the % characters from being processed as cmd file variables.  They are not passed to ExifTool.

-- \" is the escape sequence for getting a double quote intact through the command line parser.

>>> Note that the $Directory replacement contains a forward slash, while Windows syntax requires a back slash.  <<<

I would think that ExifTool would know that the current run time environment is Windows, not Max or Linux, and would generate the correct path separator.

(Fortunately for me, TCC has an option to use unix style names, so I didn't have to do any post processing on the output.)

PS: It would also be useful to have a $Path variable, which adds the drive letter: to the front of $Directory.

Phil Harvey

Yes.  ExifTool always uses the forward slash for a directory separator because the Perl i/o routines accept this form on all platforms.

$directory will include a drive specifier if you put it in the target directory name (ie. use "c:/images" instead of ".").

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).