Advertisement
Guest User

Generate index.html of JPG files in a Visual How To Format

a guest
Mar 20th, 2016
219
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Batch 1.46 KB | None | 0 0
  1.  
  2.  
  3. REM     Title:      "Generate index.html of JPG files in a Visual How To Format" Simple Utility 1.0
  4.  
  5. REM     Format:     Windows BAT file, no dependencies.
  6.  
  7. REM     Summary:    This is a simple Windows BAT file that will generate an index.html
  8. REM                 of all the .jpg files in alphabetical order. The user can input
  9. REM                 steps corrilating to each file.
  10.  
  11. REM     Demo:       http://virasawmi.com/gordon/html/how_to/open_irfanview/
  12.  
  13. REM     Download:   http://virasawmi.com/gordon/html/how_to/open_irfanview/Generate.bat
  14.            
  15. REM     Why?:       I needed a quick way to make how to documents at work. I use SnagIt to make screen caps.
  16.  
  17. @echo off
  18. del index.html
  19. dir /b /ON *.jpg > input.txt
  20. cls
  21.  
  22. set input=
  23. set instruction=
  24. set /P input=Input the title of the document: %=%
  25.  
  26. echo ^<html^>^<body^>^<font face^="helvetica, geneva, sans serif"^>^<title^>%input%^</title^>^<h1^>%input%^</h1^>^<hr^> >> index.html
  27. echo. >> index.html
  28.  
  29. set /a c=0
  30.  
  31. for /f "tokens=*" %%a in (input.txt) do call :processline %%a
  32.  
  33. echo ^</font^>^</body^>^</html^> >> index.html
  34. echo.
  35. echo.
  36. echo Output: index.html
  37.  
  38. del input.txt
  39.  
  40. goto :eof
  41.  
  42. :processline
  43. set /a c=c+1
  44. echo ^<p^>^<font color=^"#158291^"^>^<b^>Step %c%^:^</b^>^</font^>^<br^> >> index.html
  45. set /P instruction=Step %c%: %=%
  46. echo %instruction% >> index.html
  47. echo ^<br^>^<br^>^&nbsp;^&nbsp;^&nbsp;^&nbsp;^&nbsp;^&nbsp;^&nbsp;^&nbsp;^&nbsp;^&nbsp;^&nbsp;^&nbsp;^&nbsp;^<img src^="%*"^>^</p^> >> index.html
  48. echo. >> index.html
  49.  
  50. goto :eof
  51.  
  52. :eof
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement