Posted By

m1b on 10/18/11


view command image windows line photo

Versions (?)

Viewing an image under Windows 7 from a command line

 / Published in: DOS Batch

Useful to open an image for viewing from the command line under Windows, in this example the image is generated by the GraphViz dot command.

  1. @rem pick a type for the image:
  2. @set TYPE=jpeg
  4. @rem run the graphviz dot to generate the image of the given type
  5. @dot %1.gv -v -o %1.%TYPE% -T%TYPE%
  7. @rem can show it using standard Windows image viewer
  8. @rundll32.exe %SystemRoot%\System32\shimgvw.dll, ImageView_Fullscreen %CD%\%1.%TYPE%
  10. @rem or can show it using the Windows Live Essentials Photo Viewer
  11. @rem that ends up with the same as above:
  12. @rem rundll32 "%ProgramFiles(x86)%\Windows Photo Viewer\PhotoViewer.dll",ImageView_Fullscreen %CD%\%1.%TYPE%
  14. @rem or can use 3rd party viewer such as IrfanView:
  15. @rem "%ProgramFiles(x86)%\IrfanView\i_view32.exe" %1.%TYPE%
  17. @rem delete the image
  18. @del *.%TYPE%

Report this snippet  

You need to login to post a comment.