Return to Snippet

Revision: 52252
at October 18, 2011 08:52 by m1b


Initial Code
@rem pick a type for the image:
@set TYPE=jpeg

@rem run the graphviz dot to generate the image of the given type
@dot %1.gv -v -o %1.%TYPE% -T%TYPE%

@rem can show it using standard Windows image viewer
@rundll32.exe %SystemRoot%\System32\shimgvw.dll, ImageView_Fullscreen %CD%\%1.%TYPE%

@rem or can show it using the Windows Live Essentials Photo Viewer 
@rem that ends up with the same as above:
@rem rundll32 "%ProgramFiles(x86)%\Windows Photo Viewer\PhotoViewer.dll",ImageView_Fullscreen %CD%\%1.%TYPE%

@rem or can use 3rd party viewer such as IrfanView:
@rem "%ProgramFiles(x86)%\IrfanView\i_view32.exe" %1.%TYPE%

@rem delete the image
@del *.%TYPE%

Initial URL

                                

Initial Description
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.

Initial Title
Viewing an image under Windows 7 from a command line

Initial Tags
command, image, windows, line

Initial Language
DOS Batch