Advertisement
PiToLoKo

Untitled

Mar 26th, 2015
345
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Batch 1.55 KB | None | 0 0
  1. @Echo OFF & Title SparkBooth Image Renamer Tool - Debug test for incoming files
  2.  
  3. :: Date formatting.
  4. Set "Year=%date:~6,4%" & Set "Month=%date:~3,2%" & Set "Day=%date:~0,2%"
  5.  
  6. :: The image sub-directory name.
  7. Set "subDirName=%Year%_%Month%_%Day%"
  8.  
  9. :: The image base-name.
  10. Set "imageBaseName=Photo"
  11.  
  12. :: The username (if any) to fill the log.
  13. Set "userName=Elektro"
  14.  
  15. :: The amount of images to create.
  16. Set /A "imageCount=3"
  17.  
  18. Echo: This script will create dummy files on the current
  19. Echo: directory to mimic SparkBooth's filesystem.
  20. Echo+
  21. Echo: 'SparkBooth Image Renamer Tool' should be monitoring for
  22. Echo: incoming files on this directory to debug the monitor results.
  23. Echo+
  24. Pause
  25.  
  26. :Do
  27. CLS
  28. :: Create the subdirectory.
  29. (MKDir ".\%subDirName%")2>Nul
  30.  
  31. :: Delete any previous image file.
  32. (Del /Q ".\%subDirName%\*.jpg")2>Nul
  33.  
  34. :: Create dummy image files on the 'yyyy_MM_dd' sub-directory.
  35. For /L %%x In (1, 1, %imageCount%) Do (
  36.     FSUtil.exe File CreateNew ".\%subDirName%\%subDirName%_%imageBaseName%_%%x.jpg" "0"
  37. )
  38.  
  39. :: Create dummy image files on the 'Singles' sub-directory.
  40. For /L %%x In (1, 1, %imageCount%) Do (
  41.     FSUtil.exe File CreateNew ".\Singles\%subDirName%_%imageBaseName%_%%x.jpg" "0"
  42. )
  43.  
  44. :: Create the SparkBooth log with the default header.
  45. If Not Exist ".\log.txt" (
  46.     (Echo:filename  name    email   comment twitter phone)>".\log.txt"
  47. )
  48.  
  49. :: Add an entry into the log.
  50. (Echo:%subDirName%_%imageBaseName%      %userName%          )>>".\log.txt"
  51.  
  52. Echo+
  53. Echo: Done!
  54. Echo+
  55.  
  56. Choice.exe /C "YN" /M "Repeat"
  57. If %ErrorLevel% EQU 1 (Goto :Do)
  58.  
  59. Exit /B 0
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement