Rob van der Woude's Scripting Pages
Powered by GeSHi

Source code for movepictures.bat

(view source code of movepictures.bat as plain text)

  1. @echo off
  2. :: By Gordon Schumacher
  3. setlocal
  4. echo Moving pictures from camera...
  5. for /f "tokens=1-7 delims=:/-, " %%i in ('echo exit^|cmd /q /k"prompt $D $T"') do (
  6.   for /f "tokens=2-4 delims=/-,() skip=1" %%a in ('echo.^|date') do (
  7.     set dow=%%i
  8.     set %%a=%%j
  9.     set %%b=%%k
  10.     set %%c=%%l
  11.     set hh=%%m
  12.     set min=%%n
  13.     set ss=%%o
  14.   )
  15. )
  16. for /D %%D in (D:\DCIM\*.) do (
  17.   for %%F in (%%D\*.jpg) do (
  18.     call:MOVEPIC %%F
  19.   )
  20. )
  21. endlocal
  22. goto:EOF
  23.  
  24.  
  25. :MOVEPIC
  26.   set picnum=0
  27.   :incrpic
  28.   set curfile=%yy%%mm%%dd%%picnum%-%~n1.jpg
  29.   if exist "%UserProfile%\My Documents\My Pictures\%curfile%" (
  30.     set /a picnum+=1
  31.     goto incrpic
  32.   )
  33.   echo Moving %1 to %curfile%...
  34.   move %1 "%UserProfile%\My Documents\My Pictures\%curfile%"
  35. goto:EOF
  36.  

page last modified: 2024-04-16; loaded in 0.0044 seconds