Search notes:

Script: dot2.bat

dot2.bat processes a Graphviz / dot file and opens the result.
The script is invoked like so:
C:\users\rene> dot2 <out-format> graph.dot
The value of <out-format> must be one that is accepted by the -T argument of dot, for example pdf, png, svg etc. (See also this link).

The script

@echo off

setlocal

if [%2] equ [] (
   echo dot2 ext dotfile
   exit /b
)

set extension=%1
set dotFile=%2
set dotFile_=%~n2%

if not exist %dotFile% (
  echo %dotFile% does not exist
  exit /b
)

dot -T%extension% -o%dotFile_%.%extension% %dotFile%

if %errorlevel% neq 0 (
  echo ErrorLevel: %errorlevel%
  exit /b
)

start %dotFile_%.%extension%
Github repository scripts-and-utilities, path: /dot2.bat

See also

Scripts

Index