@echo off if CMDEXTVERSION 1 goto extensions echo Command extensions OFF set Extensions=OFF if ["%1"] == [""] goto usage goto fin :extensions if exist "%~f1\*.PEF" goto passedDir rem If passed a directory, then no .PEF files, so skip to usage rem otherwise will just test parent directory rem attributes: drahs---- echo [%~a1] | find "[-" if errorlevel 1 goto usage if exist "%~d1%~p1*.PEF" goto passedFile goto usage :passedDir set passedDir="%~f1\" goto begin :passedFile set passedDir="%~d1%~p1" goto begin :begin title Prepare Pentax K10D .PEF files for editing in (modified) RawShooter Premium rem log on to specified drive letter pushd %~d1 rem change to specified directory pushd %passedDir% set PPBdir=C:\Program Files\Pentax\Digital Camera Utility set RSPdir=C:\Program Files\Pixmantec\RawShooter premium 2006 1.0 echo. echo Step 1. Save K10D .PEF files as .DNG, using Pentax Photo Browser echo . name as " filename .DNG " echo. echo Copy to Windows clipboard, the following directory echo . (highlight with mouse, then press Enter key) echo . %passedDir% echo the directory can then be pasted (in Pentax Photo Browser) as the save directory echo. echo Select .PEF files, click mouse button 2, "convert to DNG" echo. echo. echo Press (almost) any key to continue ... pause > nul start "%~n0" /wait /max "%PPBdir%\PPBRWS03.exe" echo. echo .PEF dir *.PEF /on /b echo. echo .DNG dir *.DNG /on /b echo. echo Step 2. Convert files from step 1, using Adobe's DNG converter echo . and clean up files created at step 1 for %%f in ( *.PEF ) do call :AdobeDNG "%%~nf" echo. echo Step 3. Process converted files, using RawShooter Premium (modified) start "%~n0" /wait "%RSPdir%\RawShooter Premium K10 K100 K110 DL2 only.exe" %passedDir% set RSPdir= set PPBdir= popd popd set passedDir= echo Press (almost) any key to close ... pause > nul goto :eof :usage echo Expedite processing of Pentax K10D .PEF RAW photos echo - save photos as .DNG, using Pentax Photo Browser echo - convert photos, using Adobe's DNG converter echo - process photos, using RawShooter Premium (modified) echo. echo Usage %~n0 'directory' or 'file' echo where 'directory' is a directory containing K10D .PEF files echo . 'file' is any file in such a directory echo. echo Use is made of 'enhanced batch parameters', available echo with command extensions in w2k (and wXP?) echo. echo Tested on w2k, should function on wXP echo (c) A. Coffey, B.Sc., 2007 why.how@gmail.com echo. echo Press (almost) any key to close ... pause > nul goto fin echo Shouldn't get here, Press Ctrl-C ... pause > nul :AdobeDNG if not exist %1.DNG goto noFile echo Process %1.PEF / .DNG "%RSPdir%\Adobe DNG Converter.exe" -c -p0 %1.DNG del %1.DNG ren %1_1.DNG %1.DNG rem ... move %1.DNG dng\%1.DNG goto :eof :noFile echo Cannot process: %1.PEF not saved as .DNG goto :eof :fin