Scanning a folder which contains spaces

Started by DT, August 05, 2016, 07:51:54 AM

Previous topic - Next topic

DT

I have problems with Exiftool to scan a folder which contain spaces.

A commandline like
d:\Tools\ExifToolGUI\ExifTool.exe -r -ext cr2 -ext dng -if "$Canon:MinFocalLength eq '17 mm'" -lensmodel -lenstype -lensID h:\ >f:\test.txt
works fine and scans H:\ and all subfolders
but
d:\Tools\ExifToolGUI\ExifTool.exe -r -ext cr2 -ext dng -if "$Canon:MinFocalLength eq '17 mm'" -lensmodel -lenstype -lensID "h:\My Media\Canon 60D\" >f:\test17-50.txt
not. It doesn't seem to scan the subfolder:

Quote1 directories scanned
    0 image files read




Phil Harvey

Try using forward slashes instead of backslashes.  I suspect that the \" character combination may be an escape sequence in the cmd.exe console.

Either that, or remove the trailing backslash and use "h:\My Media\Canon 60D"

Hmmm.  But ExifTool says "1 directories scanned".  Odd.  Maybe it is something else.

- Phil

Edit:  I just fired up Windows and tried this myself.  I get a "File not found" error if I include the trailing "\", so I can't reproduce your problem.  Without the trailing "\", it works fine for me.  This is consistent with my original theory, but not with your observations.
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

DT

"h:\My Media\Canon 60D"

seems to work. (still scanning the folder)

Is this a bug?
Since you accept
H:\
"h:\My Media\Canon 60D\"
should also work and not only
"h:\My Media\Canon 60D"

I know now that I should remove the backslash - but I am pretty sure that in some months I will struggle with the same problem again.

Phil Harvey

It is not a bug. It is a feature of the cmd.exe processor.

H:\ will work
"H:\" will not

This is because \" is an escape sequence for cmd.exe as I mentioned.

I think that this may also work:  "H:\\" but I don't have time to test this right now.  Google for "Windows command line escape" and you may learn more.

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

DT

I think that my problems were caused by something else. I was working on an external drive and only now I realise that I have only admin access to a specific folder. (thats the reason why only one folder was scanned)
I mapped that folder to a drive. And I guess that removing the mapping caused some problems.

And the tests yesterday without the backslash I did with a new folder on another drive.