 REM -- H2XSZM.BAT - 31.4 PG/SUZUKI.MOTOR(EPC/DCS) INTFC -    ..1993OCT09PE
 REM --                                           ..2007MAY05PE/2009MAY12PE
@ECHO Off
 REM -- COPYRIGHT (C) 1997-2009 H.W.PETER, WUPPERTAL .DE --
 REM -- COPYRIGHT (C) 1997-2009 PETER+GEISENDORF GMBH, SPROCKHOEVEL .DE --

 REM -- EPCSENSE=*=C:\PROGRA~1\BHPS\FF99\DCS\QUOTE*.TXT
 REM -- EPCSENSE=*=C:\PROGRA~1\BHPS\FF99\DOWNLOAD.DAT
 REM -- EPCSENSE=*=C:\PROGRA~2\BHPS\FF99\DCS\QUOTE*.TXT
 REM -- EPCSENSE=*=C:\PROGRA~2\BHPS\FF99\DOWNLOAD.DAT
 REM -- EPCSENSE=*=C:\PROGRA~3\BHPS\FF99\DCS\QUOTE*.TXT
 REM -- EPCSENSE=*=C:\PROGRA~3\BHPS\FF99\DOWNLOAD.DAT
 REM -- EPCSENSE=*="C:\Programme\BHPS\FF99\DOWNLOAD.DAT"
 REM -- EPCSENSE=*=C:\PROGRAM\BHPS\FF99\DCS\QUOTE*.TXT
 REM -- EPCSENSE=*=C:\PROGRAM\BHPS\FF99\DOWNLOAD.DAT
 REM -- EPCSENSE=!
 REM -- note: C:\"Programme"\.. not accepted in W2K.IFEXIST
 REM -- 2007MAY05PE C:\PROGRAM\FF99\BHPS\.. for SE (Program)

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

 rem ** IF "%1"=="EPC" GOTO EPC
 rem ** IF "%1"=="ETK" GOTO EPC

 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 -- H2XSZM.BAT - EPC/ETK interface --
rem ** suspended 23.2 2003FEB10PE **

:EPC
rem -- %0=H2XSZM %1=EPC/ETK *%2=homedisk *%3=homepath %4=requestor(WHO)
rem -- %5=PC4xxxxx.PGO %6=station## %7=KA/SU/YA %8=HCode %9=IdentNr
rem -- PGOEPCPI process control for START /W prefix
rem -- PGOEPCEX process control for exit (=END with W16 via A$XW16.BAT)
rem -- PGOEPCEX process control for exit (=END with W95 via H2XW95.BAT)

:EPCLOC

:EPCLOC2
rem -- BELL+HOWELL interface -- FF+FF99 1998NOV29PE --
IF NOT EXIST H2XBAH.BAT GOTO EPCLOC28
IF     EXIST C:\FINDER\FINDER.EXE GOTO EPCLOC22
IF     EXIST C:\BHroot\FICHEFINDER99.EXE GOTO EPCLOC22
GOTO   EPCLOC28
:EPCLOC22
H2XBAH.BAT %1 %2 %3 SZM %5 %6 %7 %8 %9
EXIT
:EPCLOC28

:EPCLOC4
rem -- WDS eclat interface --
IF NOT EXIST H2XWDS.BAT GOTO EPCLOC48
H2XWDS.BAT %1 %2 %3 SZM %5 %6 %7 %8 %9
EXIT
:EPCLOC48

:EPCLOCX

REM 
REM -- H2XSZM.BAT - EPC/ETK FINAL --

ECHO ---------------------------------------------
ECHO %0:
ECHO CANNOT FIND EPC INSTALLATION        ...RETURN
ECHO ETK INSTALLATION NICHT ERREICHBAR   ...RETURN
ECHO ---------------------------------------------
PAUSE
GOTO EPCEND



:EPCEND
rem -- %2
rem -- CD \
rem -- CD %3
IF EXIST           %5 GOTO EPCEND6
COPY /B PC4FID.SZM %5 /V >NUL:
:EPCEND6
GOTO ENDUP

REM 
REM -- H2XSZM.BAT - OQX order queue transfer to SUZUKI MR server/check--

:OQX

rem -- %0=H2XSZM %1=OQX/FT %2=homedisk %3=homepath --
rem -- %4=OQ*.SZM file id %5=HDLRNR(L=6) %6=T/WMJ.. %7=PSW %8=WHO --
rem -- **** 2002FEB24 preliminary test layout - prx avis 2002APR02 ****
rem -- set classpath=c:\Suzuki\%5\DealerCom;c:\Suzuki\%5\DealerCom\dcApplet.jar;c:\Suzuki\%5\DealerCom\xml.jar
rem -- set Path=C:\WINDOWS\SYSTEM;%PATH%

:OQX3
rem -- do NOT create a directory named SZMDCS (!) --
rem -- check for Suzuki/DCS references --
rem SET PGOEPCDI=C:
rem SET PGOEPCDJ=Suzuki
SET PGOEPCDL=
IF     EXIST SZMDCS\DMSCli*.exe   GOTO OQX3B

:OQX3A
IF     EXIST OQ*.SZM             DEL  OQ*.SZM
ECHO -- Suzuki DCS installation not found --
PAUSE >NUL:
rem -- CD \
GOTO OQXEND

:OQX3B
rem -- accept Suzuki entry (OQ*.SZM) --
:OQX3X
rem -- create valid destin filename entry for data export --
                        SET PGOEPCPI=_S
IF     "%6%"=="1"       SET PGOEPCPI=_D
IF     "%6%"=="T"       SET PGOEPCPI=_D
IF     "%6%"=="3"       SET PGOEPCPI=_W
IF     "%6%"=="M"       SET PGOEPCPI=_W

REM 
REM -- H2XSZM.BAT - OQX order queue transfer to SUZUKI MR server/prepare --

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

:OQX42
FOR %%A IN  (OQ*.SZM) DO COPY /B %%A SZMDCS\Upload\%5%PGOEPCPI%.txt >NUL:
IF     EXIST OQ*.SZM  DEL    OQ*.SZM
GOTO OQX46

:OQX46
DIR          SZMDCS\Upload\%5%PGOEPCPI%.txt
ECHO -------------------------------------------------
ECHO %0 - ET-Order:
ECHO -- Die zu uebertragende Datei finden Sie
ECHO -- auf diesem Computer im Verzeichnis
ECHO --     %2%3\SZMDCS\Upload
ECHO -- unter dem Namen
ECHO --     %5%PGOEPCPI%.txt
ECHO -- fuer den elektronischen Versand bereitgestellt
ECHO --
ECHO -- Start der Internet-Kommunikation...
ECHO --                                      ...RETURN
ECHO -------------------------------------------------
PAUSE >NUL:

REM 
REM -- H2XSZM.BAT - OQX order queue transfer to SUZUKI MR server/params --

rem -- try to setup DMSSettings.properties - SZM(HP).W/D:2002MAR27(TEL) --
:OQX5

CD SZMDCS

          SET PGOEPCPU="DMSSettings.properties"
IF     EXIST %PGOEPCPU%         GOTO OQX52
          SET PGOEPCPU=DMSSET~1.PRO
IF     EXIST %PGOEPCPU%         GOTO OQX52
          SET PGOEPCPU=DMSSETTI.PRO
IF     EXIST %PGOEPCPU%         GOTO OQX52
          SET PGOEPCPU=DMSSettings.properties
IF     EXIST %PGOEPCPU%         GOTO OQX52
  GOTO OQX58

:OQX52
IF     EXIST DMSSETNO.PGO       GOTO OQX58
rem -- existance of this file will prohibit update attempt --
ECHO #BY PGOFFICE>              %PGOEPCPU%
ECHO LogFileNameDMS=DMS.log>>   %PGOEPCPU%
ECHO UserName=ZD%5>>            %PGOEPCPU%
ECHO Password=%7>>              %PGOEPCPU%
ECHO FileUploadDir=Upload>>     %PGOEPCPU%
ECHO FileMoveDir=Sent>>         %PGOEPCPU%
ECHO FileDownloadDir=Download>> %PGOEPCPU%
ECHO lang=DE>>                  %PGOEPCPU%
:OQX58

REM 
REM -- H2XSZM.BAT - OQX order queue transfer to SUZUKI MR server/transfer --

rem -- try to call link procedure(s) --
:OQX6
GOTO OQX62

:OQX62

:OQX63
IF     EXIST DMSCli*.exe     GOTO OQX632
ECHO -- Suzuki DMSClient.exe not available --
PAUSE >NUL:
GOTO OQX638
:OQX632
                        SET PGOEPCPI=S
IF     "%6%"=="1"       SET PGOEPCPI=D
IF     "%6%"=="T"       SET PGOEPCPI=D
IF     "%6%"=="3"       SET PGOEPCPI=W
IF     "%6%"=="M"       SET PGOEPCPI=W
IF NOT "%PGOEPCDL%"=="" SET PGOEPCPI=%PGOEPCDL%

          SET PGOEPCPX=DMSCLI~1.EXE
IF     EXIST %PGOEPCPX%         GOTO OQX634
          SET PGOEPCPX=DMSClient.exe
IF     EXIST %PGOEPCPX%         GOTO OQX634
          SET PGOEPCPX=DMSClien.exe
IF     EXIST %PGOEPCPX%         GOTO OQX634
          SET PGOEPCPX="DMSClient.exe"

:OQX634
rem -- WinXP: Start "title"... 2005MAY24PE
       START /wait %PGOEPCPX% %PGOEPCPI%
GOTO OQX638
:OQX638

:OQX64

REM 
REM -- H2XSZM.BAT - OQX order queue transfer to SUZUKI MR server/analyze --

:OQX66

CD ..

ECHO -------------------------------------------------
ECHO --
ECHO -- Die Internet-Verbindung
ECHO -- wird nicht mehr benoetigt.
ECHO --                                      ...RETURN
ECHO -------------------------------------------------
PAUSE >NUL:

rem -- initialize reply file --
IF     EXIST OR000J.DA0  DEL OR000J.DA0
IF     EXIST OR000J.DAT  REN OR000J.DAT OR000J.DA0
IF     EXIST OR000J.DA0  GOTO OQX6608
ECHO #SIEDCS0 BY PGOFFICE>              OR000J.DA0
:OQX6608
   
IF NOT EXIST SZMDCS\Sent\*.txt                 GOTO OQX66S8
rem -- append data sent report to reply file
ECHO #SIEDCSS BY PGOFFICE>>             OR000J.DA0
FOR %%A IN  (SZMDCS\Sent\*.txt) DO TYPE %%A >> OR000J.DA0
DEL          SZMDCS\Sent\*.txt
:OQX66S8

IF NOT EXIST SZMDCS\DMS.log                    GOTO OQX66L8
rem -- append xfer report to reply file
ECHO #SIEDCSL BY PGOFFICE>>             OR000J.DA0
FOR %%A IN  (SZMDCS\DMS.log) DO TYPE %%A >> OR000J.DA0
DEL          SZMDCS\DMS.log 
:OQX66L8

IF NOT EXIST SZMDCS\Download\*.txt             GOTO OQX66D8
rem -- append download report to reply file
ECHO #SIEDCSD BY PGOFFICE>>             OR000J.DA0
FOR %%A IN  (SZMDCS\Download\*.txt)  DO TYPE %%A >> OR000J.DA0
DEL          SZMDCS\Download\*.txt
:OQX66D8

GOTO OQX68
:OQX68
IF     EXIST OR000J.DA9  DEL OR000J.DA9
IF     EXIST OR000J.DA8  REN OR000J.DA8 OR000J.DA9
IF     EXIST OR000J.DA7  REN OR000J.DA7 OR000J.DA8
IF     EXIST OR000J.DA6  REN OR000J.DA6 OR000J.DA7
IF     EXIST OR000J.DA5  REN OR000J.DA5 OR000J.DA6
IF     EXIST OR000J.DA4  REN OR000J.DA4 OR000J.DA5
IF     EXIST OR000J.DA3  REN OR000J.DA3 OR000J.DA4
IF     EXIST OR000J.DA2  REN OR000J.DA2 OR000J.DA3
IF     EXIST OR000J.DA1  REN OR000J.DA1 OR000J.DA2
IF     EXIST OR000J.DA0  REN OR000J.DA0 OR000J.DA1
                     COPY /B OR000J.DA1 OR000J.DAT

GOTO OQXEND

:OQXEND
GOTO ENDUP

REM 
REM -- H2XSZM.BAT - FINAL --

:ENDUP
SET PGOEPCDI=
SET PGOEPCDJ=
SET PGOEPCDL=
SET PGOEPCPD=
SET PGOEPCPI=
SET PGOEPCPU=
SET PGOEPCPx=

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
