Skip to content

Instantly share code, notes, and snippets.

@pcolazurdo
Created January 23, 2015 20:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pcolazurdo/f53f078ba42b51caf6b4 to your computer and use it in GitHub Desktop.
Save pcolazurdo/f53f078ba42b51caf6b4 to your computer and use it in GitHub Desktop.
Specific Cammera Import with tagging files
REM @echo off
set PAUSE=YES
Set SourcePics=c:\temp\DCIM
rem set CameraDrive=I:
set ExifPath=C:\Program Files (x86)\bin\
set StageDrive=E:
set StagePath=E:\home\All Users\Orig\Stage
set MyPicsPath=C:\Users\Public\Pictures\New Folder
Set MyPicsDrive=C:
IF %PAUSE%==YES pause
REM Checks
rem if not exist "%CameraDrive%\DCIM" goto ERROR
if not exist "%ExifPath%" goto ERROR
if not exist "%StagePath%" goto ERROR
if not exist "%MyPicsPath%" goto ERROR
if not exist "%SourcePics%" goto ERROR
IF %PAUSE%==YES pause
Echo ExifPath "%ExifPath%"
echo StageDrive "%StageDrive%"
Echo StagePath "%StagePath%"
Echo MyPcisPath "%MyPicsPath%"
echo SourcePics "%SourcePics%"
IF %PAUSE%==YES pause
REM Remove Old Files in Stage -- Be careful
%StageDrive%
cd "%StagePath%"
IF %PAUSE%==YES pause
for /D %%n in (*.*) do rd %%n /s
IF %PAUSE%==YES pause
Rem Create New Folder in Stage using today date
set da=%date:/20=%
echo We're going to create %da:/=%
IF %PAUSE%==YES pause
md "%da:/=%"
cd "%da:/=%"
IF %PAUSE%==YES pause
Rem Copy files from the Cammera to Stage
xcopy "%SourcePics%" /S /E
IF %PAUSE%==YES pause
Rem After having copied files from the cammera copy those to the Orig Folder before touching them
cd "%StagePath%"
xcopy . .. /S/E
IF %PAUSE%==YES pause
Rem Now modify the stage directory using the Exiftool Command
"%ExifPath%exiftool.exe" -overwrite_original -r -ext jpg -d %%Y "-copyright<'Copyright $createdate, Pablo E. Colazurdo'" *
"%ExifPath%exiftool.exe" -r -ext jpg "-FileName<CreateDate" -d "%%Y%%m%%d_%%H%%M%%S%%%%c.%%%%e" *
IF %PAUSE%==YES pause
set CameraDrive=
set ExifPath=
set StagePath=
set StageDrive=
set MyPicsPath=
set MyPicsDrive=
set PAUSE=
goto END
:ERROR
echo Se encontré un problema con algunos de los directorios esperados. Por favor revise que existan los siguientes directorios y que sean accesibles
echo %CameraDrive%\DCIM
echo %ExifPath%
echo %StagePath%
echo %MyPicsPath%
IF %PAUSE%==YES pause
:END
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment