 REM -- H2XPIA.BAT - 31.3 PGO/PIAGGIO/VESPA(EPC) INTFC - ...... 1997FEB07VM
 REM                                               /2004NOV22PE/2008DEC02PE
@ECHO Off
 REM -- COPYRIGHT (C) 1997-2008 H.W.PETER, WUPPERTAL .DE --
 REM -- COPYRIGHT (C) 1997-2008 PETER+GEISENDORF GMBH, SPROCKHOEVEL .DE --
 REM -- \\UFN=OK, 2002OCT18PE

REM -- EPCSENSE=*=C:\PIAGGIO\CATALOGO\ORDINI\ORDINE.ORD
REM -- EPCSENSE=*=C:\PIAGGIO\CATALOGO\ORDINE.ORD
REM -- EPCSENSE=*=C:\CATALOGO\ORDINI\ORDINE.ORD
REM -- EPCSENSE=*=C:\CATALOGO\ORDINE.ORD
REM -- EPCSENSE=*=C:\Catalo~1\preven~1\*.ord
REM -- EPCSENSE=*=C:\Catalo~2\preven~1\*.ord
REM -- EPCSENSE=*=C:\Catalo~3\preven~1\*.ord
REM -- EPCSENSE=*="C:\CatalogoPiaggio\preventivi\*.ord"
REM -- EPCSENSE=!

 REM 6789.123456789.123456789.123456789.123456789.123456789.123456789.12345
 REM ----------------------------------------------------------------------

 REM -- compare H2XAPR.BAT, H2XGUZ.BAT, H2XPIA.BAT ------------------------

 IF "%1"=="OQX" GOTO OQX
 IF "%1"=="FT"  GOTO OQX

ECHO ----------------------------------------------------------
ECHO %0:
ECHO INVALID CONTEXT CALL
ECHO UNGUELTIGER AUFRUF
ECHO ----------------------------------------------------------
ECHO %0 %1 %2 %3 %4 %5 %6 %7 %8 %9
PAUSE
GOTO ENDUP

REM 
REM -- H2XPIA.BAT - OQX order queue transfer to PIAGGIO for PIAGGIO --

:OQX
rem -- %0=H2XPIA %1=OQX/FT *%2=homedisk *%3=homepath --
rem -- %4=OQ*.PIA file id --

:OQX2
rem -- create valid directory entry for data export --
IF     EXIST C:\PGEXPORT\*.*      GOTO OQX20
IF     EXIST C:\PGEXPORT\NUL:     GOTO OQX20
IF     EXIST C:\PGEXPORT\NUL      GOTO OQX20
MD           C:\PGEXPORT
:OQX20
CLS

rem -- post file(s) to transfer --
:OQX4
IF     EXIST OQ*.PIA  GOTO OQX42
ECHO -------------------------------------------------
ECHO -- HINWEIS: 
ECHO -- Es stehen keine NEUEN Order-Bestaende zur
ECHO -- Uebertragung zur Verfuegung.
ECHO --
GOTO OQX46

:OQX42
IF     EXIST C:\PGEXPORT\ORDPIA.TXT  DEL C:\PGEXPORT\ORDPIA.TXT
REM                                   >  C:\PGEXPORT\ORDPIA.TXT
FOR %%A IN  (OQ*.PIA)     DO TYPE %%A >> C:\PGEXPORT\ORDPIA.TXT
DEL          OQ*.PIA
GOTO OQX46

:OQX46
DIR          C:\PGEXPORT\ORDPIA.TXT
ECHO -------------------------------------------------
ECHO %0 - ET-Order:
ECHO -- Die zu uebertragende Datei finden Sie
ECHO -- auf diesem Computer im Verzeichnis C:\PGEXPORT
ECHO -- unter dem Namen  ORDPIA.TXT (s.o.)
ECHO -- fuer den elektronischen Versand bereitgestellt
ECHO --                                      ...RETURN
ECHO -------------------------------------------------
PAUSE >NUL:

:OQX6
rem -- try to call link procedure --
IF     EXIST H2XPIA.HTM GOTO OQX60
GOTO OQX68
:OQX60
START        H2XPIA.HTM
GOTO OQX68
:OQX68
rem -- CD \
GOTO OQXEND

:OQXEND
GOTO ENDUP

REM 
REM -- H2XPIA.BAT - FINAL --

:ENDUP
SET PGOEPCPI=

REM -- now return to PGO home drive and resume PGO mainline --
rem -- %2
rem -- CD \
rem -- CD %3
SET  PGOEPCPI=PGOBEG
IF "%PGONETID%"=="W10" SET PGOEPCPI=START /R /MAX PGOFFICE.PIF
IF "%PGONETID%"=="W16" SET PGOEPCPI=START /R /MAX PGOFFICE.PIF
IF "%PGONETID%"=="W95" SET PGOEPCPI=START /R /MAX PGOFFICE.PIF
IF "%PGOEPCEX%"=="END" SET PGOEPCPI=
%PGOEPCPI%
EXIT
