/* gsdaemon v0.0.1 (c) Alex Samorukov, 2004 */

/* settings: */
psfonts="c:/psfonts"; /* ps fonts location, use "/". */
outport="lpt2" /* output where your real printer is attached */
monport="lpt3" /* Port on which daemon will capture all data */
resolution=600 /* printer resolution. Can be 300 or 600 */

/* source */
say "starting daemon "
parse source scriptpath
scriptpath=word(scriptpath,3)
scriptpath=filespec("drive",scriptpath)||filespec("path",scriptpath)
gslibpath=translate(substr(scriptpath,1,length(scriptpath)-4)||"lib","/","\")
scriptpath=substr(scriptpath,1,length(scriptpath)-1);
curpath=directory();
call directory scriptpath
'@echo off'
'set gs_lib='||gslibpath||';c:/psfonts'
'set gs_load=10'
'printmon '||monport||' "gsos2 -r'||resolution||' -sDEVICE=gdi -dNOPAUSE -sOUTPUTFILE='||outport||' -q -"'
call directory curpath