You may be diappointed to know that Windows&#x27; cmd.exe will automatically open the default associated program, so all you need to do is enter the filename if you&#x27;ve associated image files with a default viewer:<p><a href="http:&#x2F;&#x2F;superuser.com&#x2F;questions&#x2F;246825&#x2F;open-file-from-the-command-line-on-windows" rel="nofollow">http:&#x2F;&#x2F;superuser.com&#x2F;questions&#x2F;246825&#x2F;open-file-from-the-com...</a><p>(I suppose a similar thing could be done on *nix with a suitably modified execlp()&#x2F;execvp().)