Batch command difficulties

Started by Steve055, May 26, 2013, 07:18:55 PM

Previous topic - Next topic

Steve055

Hi Folks, I am on day two of attempting to get one of the example commands working, and would like your help, as obviously something is not right with what I am doing.

OS: Win7 (X64)
The following command is being run from within a bat file. When run the CD is %USERPROFILE%\Pictures. "Test" is a subdir of Pictures.
I have tried varying the number of % used with the variables, to no avail, I merely get "%m" etc appearing in the file name structure.

Can someone please point out where I am going wrong?

tt
"C:\Users\Steve\Documents\Batch\exiftool.exe" -r "-FileName<CreateDate" -d "%Y-%m(ToFFy)\%Y%m%d-%H%M%S_%%f%%-c.%%e" test
/tt

code
C:\Users\Steve\Pictures>..\documents\batch\picexifresolve.bat
BATCH file found

C:\Users\Steve\Pictures>"C:\Users\Steve\Documents\Batch\exiftool.exe" -r "-FileName<CreateDate" -d "m(ToFFy)\mHS_%f%-c.%e" test
Warning: Invalid EXIF text encoding - test/SNC00009.jpg
Warning: Invalid EXIF text encoding - test/SNC00016.jpg
Warning: Invalid EXIF text encoding - test/SNC00017.jpg
Warning: Invalid EXIF text encoding - test/SNC00020.jpg
Warning: Invalid EXIF text encoding - test/SNC00024.jpg
Warning: Invalid EXIF text encoding - test/SNC00025.jpg
Warning: Invalid EXIF text encoding - test/SNC00026.jpg
Warning: Invalid EXIF text encoding - test/SNC00027.jpg
Warning: Invalid EXIF text encoding - test/SNC00028.jpg
Warning: Invalid EXIF text encoding - test/SNC00138.jpg
Warning: Invalid EXIF text encoding - test/SNC00139.jpg
Warning: Invalid EXIF text encoding - test/SNC00140.jpg
    1 directories scanned
    1 directories created
   12 image files updated
/code             

Phil Harvey

In a Windows .bat file, all "%" characters must be doubled:

"C:\Users\Steve\Documents\Batch\exiftool.exe" -r "-FileName<CreateDate" -d "%%Y-%%m(ToFFy)\%%Y%m%%d-%%H%%M%%S_%%%%f%%%%-c.%%%%e" test

I assume that "test" is the name of a directory containing images?

- 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 ($).

Steve055

Thankyou Phil,
                       
As the file variables appeared to be working, doubling their '%' to four had eluded me.

The bat file is now working as intended. :)