@echo off for /f "tokens=*" %%i in ('exiftool -q -q -gpslatitude -gpslongitude -T -c "%%d%%d'%%.2f" "%~1"') do set COORDS=%%i if "x%COORDS:-=%"=="x%COORDS%" ( explorer "http://www.google.com/maps/place/%COORDS%" ) else ( ECHO That picture does not have GPS coordinates attached! pause )