@ECHO OFF
REM NDIRTSTA.BAT
REM Automated NDIR compare test for MARS NWE.
REM
REM OUT/PUBOUT:
REM   Novell NPUBLIC\NDIR baseline vs PUBLIC\NDIR implementation.
REM
REM UNOV/UPUB:
REM   NOPASSUSER context readback, started through DLYSTRT.
REM
REM SHORTOUT/USHORT:
REM   PUBLIC-only /SHORT helper output. /SHORT is our local option and is
REM   not compared against Novell NDIR.
REM
REM Required for user-context part:
REM   SET LGNTPWD=<supervisor-password>

IF "%1"=="" GOTO PART1
IF "%1"=="PART2" GOTO PART2
IF "%1"=="part2" GOTO PART2
IF "%1"=="Part2" GOTO PART2
GOTO USAGE

:USAGE
ECHO Usage: NDIRTSTA [PART2]
ECHO.
ECHO For full automatic user-context test first set:
ECHO   SET LGNTPWD=dein-supervisor-passwort
GOTO END

:PART1
IF "%LGNTPWD%"=="" GOTO NEEDPWD

F:
CD \

REM --- Clean generated test/result directories. ---
IF EXIST TNDIR\NUL DELTREE /Y TNDIR > NUL
IF EXIST NDCMP\NUL DELTREE /Y NDCMP > NUL
IF EXIST C:\NDIRTMP\NUL DELTREE /Y C:\NDIRTMP > NUL

REM --- Directory setup. ---
MD TNDIR
MD TNDIR\SUBDIR
MD TNDIR\SUBDIR\DEEP
MD TNDIR\URF
MD TNDIR\UFULL
MD TNDIR\US
MD TNDIR\UNONE
MD TNDIR\USUB
MD TNDIR\USUB\CHILD
MD TNDIR\MAT
MD TNDIR\MAT\D_NORM
MD TNDIR\MAT\D_HID
MD TNDIR\MAT\D_SYS
MD TNDIR\MAT\D_PUR
MD TNDIR\MAT\D_DIRI
MD TNDIR\MAT\D_MIX
MD TNDIR\MAT\D_SUB
MD TNDIR\MAT\D_SUB\CHILD
MD TNDIR\USR
MD TNDIR\USR\U_EVERYR
MD TNDIR\USR\U_EVERYF
MD TNDIR\USR\U_MARIO
MD TNDIR\USR\U_GUEST
MD TNDIR\USR\U_NOPWCM
MD TNDIR\USR\U_NOPREM
MD TNDIR\USR\U_NOPRF
MD TNDIR\USR\U_CHILD
MD TNDIR\USR\U_CHILD\DEEP

MD NDCMP
MD NDCMP\OUT
MD NDCMP\PUBOUT
MD NDCMP\SETUP
MD NDCMP\SHORTOUT
MD NDCMP\UNOV
MD NDCMP\UPUB
MD NDCMP\USHORT
MD NDCMP\USETUP

ECHO NDIRTSTA NDIR compare test > F:\NDCMP\RUN.LOG
ECHO Date/time stamp skipped to avoid DOS prompt. >> F:\NDCMP\RUN.LOG
ECHO. >> F:\NDCMP\RUN.LOG

REM --- Test files. ---
ECHO NDIR TEST ALPHA > F:\TNDIR\ALPHA.TXT
ECHO NDIR TEST BETA > F:\TNDIR\BETA.TXT
ECHO NDIR TEST GAMMA > F:\TNDIR\GAMMA.DAT
ECHO NDIR SUB FILE > F:\TNDIR\SUBDIR\SUB.TXT
ECHO NDIR DEEP FILE > F:\TNDIR\SUBDIR\DEEP\DEEP.TXT
ECHO NDIR RF FILE > F:\TNDIR\URF\RF.TXT
ECHO NDIR FULL FILE > F:\TNDIR\UFULL\FULL.TXT
ECHO NDIR S FILE > F:\TNDIR\US\S.TXT
ECHO NDIR N FILE > F:\TNDIR\UNONE\N.TXT
ECHO NDIR USUB FILE > F:\TNDIR\USUB\ROOT.TXT
ECHO NDIR USUB CHILD > F:\TNDIR\USUB\CHILD\CHILD.TXT
ECHO MAT NORMAL > F:\TNDIR\MAT\NORMAL.TXT
ECHO MAT HIDDEN > F:\TNDIR\MAT\HIDFILE.TXT
ECHO MAT READONLY > F:\TNDIR\MAT\ROFILE.TXT
ECHO MAT SYSTEM > F:\TNDIR\MAT\SYSFILE.DAT
ECHO MAT ARCHIVE > F:\TNDIR\MAT\ARCFILE.BIN
ECHO MAT INHIBIT > F:\TNDIR\MAT\DIRIFILE.TXT
ECHO MAT MIXED > F:\TNDIR\MAT\MIXFILE.TXT
ECHO MAT SUB ROOT > F:\TNDIR\MAT\D_SUB\ROOT.TXT
ECHO MAT SUB CHILD > F:\TNDIR\MAT\D_SUB\CHILD\CHILD.TXT
ECHO USER EVERY R > F:\TNDIR\USR\U_EVERYR\E_R.TXT
ECHO USER EVERY FULL > F:\TNDIR\USR\U_EVERYF\E_FULL.TXT
ECHO USER MARIO RF > F:\TNDIR\USR\U_MARIO\MARIO.TXT
ECHO USER GUEST RF > F:\TNDIR\USR\U_GUEST\GUEST.TXT
ECHO USER NOP WCM > F:\TNDIR\USR\U_NOPWCM\WCM.TXT
ECHO USER NOP REMA > F:\TNDIR\USR\U_NOPREM\REMA.TXT
ECHO USER NOP RF > F:\TNDIR\USR\U_NOPRF\RF.TXT
ECHO USER CHILD ROOT > F:\TNDIR\USR\U_CHILD\ROOT.TXT
ECHO USER CHILD DEEP > F:\TNDIR\USR\U_CHILD\DEEP\DEEP.TXT

ECHO === ATTRIBUTE CLEANUP === >> F:\NDCMP\RUN.LOG
\NPUBLIC\FLAG F:\TNDIR\ALPHA.TXT N >> F:\NDCMP\RUN.LOG
\NPUBLIC\FLAG F:\TNDIR\BETA.TXT N >> F:\NDCMP\RUN.LOG
\NPUBLIC\FLAG F:\TNDIR\GAMMA.DAT N >> F:\NDCMP\RUN.LOG
\NPUBLIC\FLAG F:\TNDIR\SUBDIR\SUB.TXT N >> F:\NDCMP\RUN.LOG
\NPUBLIC\FLAG F:\TNDIR\MAT\NORMAL.TXT N >> F:\NDCMP\RUN.LOG
\NPUBLIC\FLAG F:\TNDIR\MAT\HIDFILE.TXT N >> F:\NDCMP\RUN.LOG
\NPUBLIC\FLAG F:\TNDIR\MAT\ROFILE.TXT N >> F:\NDCMP\RUN.LOG
\NPUBLIC\FLAG F:\TNDIR\MAT\SYSFILE.DAT N >> F:\NDCMP\RUN.LOG
\NPUBLIC\FLAG F:\TNDIR\MAT\ARCFILE.BIN N >> F:\NDCMP\RUN.LOG
\NPUBLIC\FLAG F:\TNDIR\MAT\DIRIFILE.TXT N >> F:\NDCMP\RUN.LOG
\NPUBLIC\FLAG F:\TNDIR\MAT\MIXFILE.TXT N >> F:\NDCMP\RUN.LOG
\NPUBLIC\FLAGDIR F:\TNDIR\MAT\D_NORM Normal >> F:\NDCMP\RUN.LOG
\NPUBLIC\FLAGDIR F:\TNDIR\MAT\D_HID Normal >> F:\NDCMP\RUN.LOG
\NPUBLIC\FLAGDIR F:\TNDIR\MAT\D_SYS Normal >> F:\NDCMP\RUN.LOG
\NPUBLIC\FLAGDIR F:\TNDIR\MAT\D_PUR Normal >> F:\NDCMP\RUN.LOG
\NPUBLIC\FLAGDIR F:\TNDIR\MAT\D_DIRI Normal >> F:\NDCMP\RUN.LOG
\NPUBLIC\FLAGDIR F:\TNDIR\MAT\D_MIX Normal >> F:\NDCMP\RUN.LOG

ECHO === D01 BASIS DIRECTORY === >> F:\NDCMP\RUN.LOG
\NPUBLIC\NDIR F:\TNDIR > F:\NDCMP\OUT\D01_ROOT.OUT
\PUBLIC\NDIR F:\TNDIR > F:\NDCMP\PUBOUT\D01_ROOT.OUT

ECHO === D02 DIRECT FILE === >> F:\NDCMP\RUN.LOG
\NPUBLIC\NDIR F:\TNDIR\ALPHA.TXT > F:\NDCMP\OUT\D02_ALFA.OUT
\PUBLIC\NDIR F:\TNDIR\ALPHA.TXT > F:\NDCMP\PUBOUT\D02_ALFA.OUT

ECHO === D03 DATES === >> F:\NDCMP\RUN.LOG
\NPUBLIC\NDIR F:\TNDIR /DATES > F:\NDCMP\OUT\D03_DATE.OUT
\PUBLIC\NDIR F:\TNDIR /DATES > F:\NDCMP\PUBOUT\D03_DATE.OUT

ECHO === D04 RIGHTS === >> F:\NDCMP\RUN.LOG
\NPUBLIC\NDIR F:\TNDIR /RIGHTS > F:\NDCMP\OUT\D04_RGHT.OUT
\PUBLIC\NDIR F:\TNDIR /RIGHTS > F:\NDCMP\PUBOUT\D04_RGHT.OUT

ECHO === D05 SET ATTRIBUTES === >> F:\NDCMP\RUN.LOG
\NPUBLIC\FLAG F:\TNDIR\ALPHA.TXT +H >> F:\NDCMP\RUN.LOG
\NPUBLIC\FLAG F:\TNDIR\BETA.TXT +RO >> F:\NDCMP\RUN.LOG
\NPUBLIC\FLAG F:\TNDIR\GAMMA.DAT +Sy +A >> F:\NDCMP\RUN.LOG
\NPUBLIC\NDIR F:\TNDIR > F:\NDCMP\OUT\D05_ATTR.OUT
\PUBLIC\NDIR F:\TNDIR > F:\NDCMP\PUBOUT\D05_ATTR.OUT

ECHO === D06 ATTRIBUTE FILTERS === >> F:\NDCMP\RUN.LOG
\NPUBLIC\NDIR F:\TNDIR /H > F:\NDCMP\OUT\D06_H.OUT
\PUBLIC\NDIR F:\TNDIR /H > F:\NDCMP\PUBOUT\D06_H.OUT
\NPUBLIC\NDIR F:\TNDIR /RO > F:\NDCMP\OUT\D07_RO.OUT
\PUBLIC\NDIR F:\TNDIR /RO > F:\NDCMP\PUBOUT\D07_RO.OUT
\NPUBLIC\NDIR F:\TNDIR /SY > F:\NDCMP\OUT\D08_SY.OUT
\PUBLIC\NDIR F:\TNDIR /SY > F:\NDCMP\PUBOUT\D08_SY.OUT
\NPUBLIC\NDIR F:\TNDIR /A > F:\NDCMP\OUT\D09_A.OUT
\PUBLIC\NDIR F:\TNDIR /A > F:\NDCMP\PUBOUT\D09_A.OUT

ECHO === D10 NOT FILTER === >> F:\NDCMP\RUN.LOG
\NPUBLIC\NDIR F:\TNDIR /NOT H > F:\NDCMP\OUT\D10_NOTH.OUT
\PUBLIC\NDIR F:\TNDIR /NOT H > F:\NDCMP\PUBOUT\D10_NOTH.OUT

ECHO === D11 WILDCARDS === >> F:\NDCMP\RUN.LOG
\NPUBLIC\NDIR F:\TNDIR\*.TXT > F:\NDCMP\OUT\D11_TXT.OUT
\PUBLIC\NDIR F:\TNDIR\*.TXT > F:\NDCMP\PUBOUT\D11_TXT.OUT
\NPUBLIC\NDIR F:\TNDIR\*.DAT > F:\NDCMP\OUT\D12_DAT.OUT
\PUBLIC\NDIR F:\TNDIR\*.DAT > F:\NDCMP\PUBOUT\D12_DAT.OUT

ECHO === D13 FILES/DIRS ONLY === >> F:\NDCMP\RUN.LOG
\NPUBLIC\NDIR F:\TNDIR /FO > F:\NDCMP\OUT\D13_FO.OUT
\PUBLIC\NDIR F:\TNDIR /FO > F:\NDCMP\PUBOUT\D13_FO.OUT
\NPUBLIC\NDIR F:\TNDIR /DO > F:\NDCMP\OUT\D14_DO.OUT
\PUBLIC\NDIR F:\TNDIR /DO > F:\NDCMP\PUBOUT\D14_DO.OUT

ECHO === D15 SUBDIRECTORY === >> F:\NDCMP\RUN.LOG
\NPUBLIC\NDIR F:\TNDIR /SUB > F:\NDCMP\OUT\D15_SUB.OUT
\PUBLIC\NDIR F:\TNDIR /SUB > F:\NDCMP\PUBOUT\D15_SUB.OUT
\NPUBLIC\NDIR F:\TNDIR /SUB /RIGHTS > F:\NDCMP\OUT\D16_SUBR.OUT
\PUBLIC\NDIR F:\TNDIR /SUB /RIGHTS > F:\NDCMP\PUBOUT\D16_SUBR.OUT


ECHO === D17 FILE/DIR ATTRIBUTE MATRIX SETUP === >> F:\NDCMP\RUN.LOG
\NPUBLIC\FLAG F:\TNDIR\MAT\HIDFILE.TXT +H >> F:\NDCMP\RUN.LOG
\NPUBLIC\FLAG F:\TNDIR\MAT\ROFILE.TXT +RO >> F:\NDCMP\RUN.LOG
\NPUBLIC\FLAG F:\TNDIR\MAT\SYSFILE.DAT +Sy >> F:\NDCMP\RUN.LOG
\NPUBLIC\FLAG F:\TNDIR\MAT\ARCFILE.BIN +A >> F:\NDCMP\RUN.LOG
\NPUBLIC\FLAG F:\TNDIR\MAT\DIRIFILE.TXT +DI +RI >> F:\NDCMP\RUN.LOG
\NPUBLIC\FLAG F:\TNDIR\MAT\MIXFILE.TXT +H +RO +A >> F:\NDCMP\RUN.LOG
\NPUBLIC\FLAGDIR F:\TNDIR\MAT\D_HID Hidden >> F:\NDCMP\RUN.LOG
\NPUBLIC\FLAGDIR F:\TNDIR\MAT\D_SYS System >> F:\NDCMP\RUN.LOG
\NPUBLIC\FLAGDIR F:\TNDIR\MAT\D_PUR Purge >> F:\NDCMP\RUN.LOG
\NPUBLIC\FLAGDIR F:\TNDIR\MAT\D_DIRI Deleteinhibit Renameinhibit >> F:\NDCMP\RUN.LOG
\NPUBLIC\FLAGDIR F:\TNDIR\MAT\D_MIX Hidden System Purge >> F:\NDCMP\RUN.LOG

ECHO === D17-D29 FILE/DIR ATTRIBUTE MATRIX === >> F:\NDCMP\RUN.LOG
\NPUBLIC\NDIR F:\TNDIR\MAT > F:\NDCMP\OUT\D17_MATR.OUT
\PUBLIC\NDIR F:\TNDIR\MAT > F:\NDCMP\PUBOUT\D17_MATR.OUT
\NPUBLIC\NDIR F:\TNDIR\MAT /DATES > F:\NDCMP\OUT\D18_MDAT.OUT
\PUBLIC\NDIR F:\TNDIR\MAT /DATES > F:\NDCMP\PUBOUT\D18_MDAT.OUT
\NPUBLIC\NDIR F:\TNDIR\MAT /RIGHTS > F:\NDCMP\OUT\D19_MRGT.OUT
\PUBLIC\NDIR F:\TNDIR\MAT /RIGHTS > F:\NDCMP\PUBOUT\D19_MRGT.OUT
\NPUBLIC\NDIR F:\TNDIR\MAT /FO > F:\NDCMP\OUT\D20_MFO.OUT
\PUBLIC\NDIR F:\TNDIR\MAT /FO > F:\NDCMP\PUBOUT\D20_MFO.OUT
\NPUBLIC\NDIR F:\TNDIR\MAT /DO > F:\NDCMP\OUT\D21_MDO.OUT
\PUBLIC\NDIR F:\TNDIR\MAT /DO > F:\NDCMP\PUBOUT\D21_MDO.OUT
\NPUBLIC\NDIR F:\TNDIR\MAT /SUB > F:\NDCMP\OUT\D22_MSUB.OUT
\PUBLIC\NDIR F:\TNDIR\MAT /SUB > F:\NDCMP\PUBOUT\D22_MSUB.OUT
\NPUBLIC\NDIR F:\TNDIR\MAT /SUB /RIGHTS > F:\NDCMP\OUT\D23_MSRG.OUT
\PUBLIC\NDIR F:\TNDIR\MAT /SUB /RIGHTS > F:\NDCMP\PUBOUT\D23_MSRG.OUT
\NPUBLIC\NDIR F:\TNDIR\MAT /H > F:\NDCMP\OUT\D24_MH.OUT
\PUBLIC\NDIR F:\TNDIR\MAT /H > F:\NDCMP\PUBOUT\D24_MH.OUT
\NPUBLIC\NDIR F:\TNDIR\MAT /RO > F:\NDCMP\OUT\D25_MRO.OUT
\PUBLIC\NDIR F:\TNDIR\MAT /RO > F:\NDCMP\PUBOUT\D25_MRO.OUT
\NPUBLIC\NDIR F:\TNDIR\MAT /SY > F:\NDCMP\OUT\D26_MSY.OUT
\PUBLIC\NDIR F:\TNDIR\MAT /SY > F:\NDCMP\PUBOUT\D26_MSY.OUT
\NPUBLIC\NDIR F:\TNDIR\MAT /A > F:\NDCMP\OUT\D27_MA.OUT
\PUBLIC\NDIR F:\TNDIR\MAT /A > F:\NDCMP\PUBOUT\D27_MA.OUT
\NPUBLIC\NDIR F:\TNDIR\MAT /NOT H > F:\NDCMP\OUT\D28_MNH.OUT
\PUBLIC\NDIR F:\TNDIR\MAT /NOT H > F:\NDCMP\PUBOUT\D28_MNH.OUT
\NPUBLIC\NDIR F:\TNDIR\MAT\*.TXT > F:\NDCMP\OUT\D29_MTXT.OUT
\PUBLIC\NDIR F:\TNDIR\MAT\*.TXT > F:\NDCMP\PUBOUT\D29_MTXT.OUT

ECHO === D30-D34 USER/TRUSTEE MATRIX DIRECT === >> F:\NDCMP\RUN.LOG
\NPUBLIC\NDIR F:\TNDIR\USR /RIGHTS > F:\NDCMP\OUT\D30_USRR.OUT
\PUBLIC\NDIR F:\TNDIR\USR /RIGHTS > F:\NDCMP\PUBOUT\D30_USRR.OUT
\NPUBLIC\NDIR F:\TNDIR\USR /SUB /RIGHTS > F:\NDCMP\OUT\D31_USRS.OUT
\PUBLIC\NDIR F:\TNDIR\USR /SUB /RIGHTS > F:\NDCMP\PUBOUT\D31_USRS.OUT
\NPUBLIC\NDIR F:\TNDIR\USR /DO /RIGHTS > F:\NDCMP\OUT\D32_USRD.OUT
\PUBLIC\NDIR F:\TNDIR\USR /DO /RIGHTS > F:\NDCMP\PUBOUT\D32_USRD.OUT
\NPUBLIC\NDIR F:\TNDIR\USR\*.TXT > F:\NDCMP\OUT\D33_USRT.OUT
\PUBLIC\NDIR F:\TNDIR\USR\*.TXT > F:\NDCMP\PUBOUT\D33_USRT.OUT
\NPUBLIC\NDIR F:\TNDIR\USR /DATES > F:\NDCMP\OUT\D34_USRD.OUT
\PUBLIC\NDIR F:\TNDIR\USR /DATES > F:\NDCMP\PUBOUT\D34_USRD.OUT

ECHO === PUBLIC-ONLY SHORT OUTPUT === >> F:\NDCMP\RUN.LOG
\PUBLIC\NDIR F:\TNDIR /SUB /SHORT > F:\NDCMP\SHORTOUT\S15_SUB.OUT
\PUBLIC\NDIR F:\TNDIR /SUB /RIGHTS /SHORT > F:\NDCMP\SHORTOUT\S16_SUBR.OUT
\PUBLIC\NDIR F:\TNDIR\MAT /SHORT > F:\NDCMP\SHORTOUT\S17_MATR.OUT
\PUBLIC\NDIR F:\TNDIR\MAT /SUB /RIGHTS /SHORT > F:\NDCMP\SHORTOUT\S23_MSRG.OUT
\PUBLIC\NDIR F:\TNDIR\USR /SUB /RIGHTS /SHORT > F:\NDCMP\SHORTOUT\S31_USRS.OUT

ECHO === D90 MISSING / D99 HELP === >> F:\NDCMP\RUN.LOG
\NPUBLIC\NDIR F:\TNDIR\*.ZZZ > F:\NDCMP\OUT\D90_MISS.OUT
\PUBLIC\NDIR F:\TNDIR\*.ZZZ > F:\NDCMP\PUBOUT\D90_MISS.OUT
\NPUBLIC\NDIR /HELP > F:\NDCMP\OUT\D99_HELP.OUT
\PUBLIC\NDIR /HELP > F:\NDCMP\PUBOUT\D99_HELP.OUT

ECHO === DIRECT COMPARE === > F:\NDCMP\COMPARE.LOG
FC F:\NDCMP\OUT\D01_ROOT.OUT F:\NDCMP\PUBOUT\D01_ROOT.OUT >> F:\NDCMP\COMPARE.LOG
FC F:\NDCMP\OUT\D02_ALFA.OUT F:\NDCMP\PUBOUT\D02_ALFA.OUT >> F:\NDCMP\COMPARE.LOG
FC F:\NDCMP\OUT\D03_DATE.OUT F:\NDCMP\PUBOUT\D03_DATE.OUT >> F:\NDCMP\COMPARE.LOG
FC F:\NDCMP\OUT\D04_RGHT.OUT F:\NDCMP\PUBOUT\D04_RGHT.OUT >> F:\NDCMP\COMPARE.LOG
FC F:\NDCMP\OUT\D05_ATTR.OUT F:\NDCMP\PUBOUT\D05_ATTR.OUT >> F:\NDCMP\COMPARE.LOG
FC F:\NDCMP\OUT\D06_H.OUT F:\NDCMP\PUBOUT\D06_H.OUT >> F:\NDCMP\COMPARE.LOG
FC F:\NDCMP\OUT\D07_RO.OUT F:\NDCMP\PUBOUT\D07_RO.OUT >> F:\NDCMP\COMPARE.LOG
FC F:\NDCMP\OUT\D08_SY.OUT F:\NDCMP\PUBOUT\D08_SY.OUT >> F:\NDCMP\COMPARE.LOG
FC F:\NDCMP\OUT\D09_A.OUT F:\NDCMP\PUBOUT\D09_A.OUT >> F:\NDCMP\COMPARE.LOG
FC F:\NDCMP\OUT\D10_NOTH.OUT F:\NDCMP\PUBOUT\D10_NOTH.OUT >> F:\NDCMP\COMPARE.LOG
FC F:\NDCMP\OUT\D11_TXT.OUT F:\NDCMP\PUBOUT\D11_TXT.OUT >> F:\NDCMP\COMPARE.LOG
FC F:\NDCMP\OUT\D12_DAT.OUT F:\NDCMP\PUBOUT\D12_DAT.OUT >> F:\NDCMP\COMPARE.LOG
FC F:\NDCMP\OUT\D13_FO.OUT F:\NDCMP\PUBOUT\D13_FO.OUT >> F:\NDCMP\COMPARE.LOG
FC F:\NDCMP\OUT\D14_DO.OUT F:\NDCMP\PUBOUT\D14_DO.OUT >> F:\NDCMP\COMPARE.LOG
FC F:\NDCMP\OUT\D15_SUB.OUT F:\NDCMP\PUBOUT\D15_SUB.OUT >> F:\NDCMP\COMPARE.LOG
FC F:\NDCMP\OUT\D16_SUBR.OUT F:\NDCMP\PUBOUT\D16_SUBR.OUT >> F:\NDCMP\COMPARE.LOG
FC F:\NDCMP\OUT\D17_MATR.OUT F:\NDCMP\PUBOUT\D17_MATR.OUT >> F:\NDCMP\COMPARE.LOG
FC F:\NDCMP\OUT\D18_MDAT.OUT F:\NDCMP\PUBOUT\D18_MDAT.OUT >> F:\NDCMP\COMPARE.LOG
FC F:\NDCMP\OUT\D19_MRGT.OUT F:\NDCMP\PUBOUT\D19_MRGT.OUT >> F:\NDCMP\COMPARE.LOG
FC F:\NDCMP\OUT\D20_MFO.OUT F:\NDCMP\PUBOUT\D20_MFO.OUT >> F:\NDCMP\COMPARE.LOG
FC F:\NDCMP\OUT\D21_MDO.OUT F:\NDCMP\PUBOUT\D21_MDO.OUT >> F:\NDCMP\COMPARE.LOG
FC F:\NDCMP\OUT\D22_MSUB.OUT F:\NDCMP\PUBOUT\D22_MSUB.OUT >> F:\NDCMP\COMPARE.LOG
FC F:\NDCMP\OUT\D23_MSRG.OUT F:\NDCMP\PUBOUT\D23_MSRG.OUT >> F:\NDCMP\COMPARE.LOG
FC F:\NDCMP\OUT\D24_MH.OUT F:\NDCMP\PUBOUT\D24_MH.OUT >> F:\NDCMP\COMPARE.LOG
FC F:\NDCMP\OUT\D25_MRO.OUT F:\NDCMP\PUBOUT\D25_MRO.OUT >> F:\NDCMP\COMPARE.LOG
FC F:\NDCMP\OUT\D26_MSY.OUT F:\NDCMP\PUBOUT\D26_MSY.OUT >> F:\NDCMP\COMPARE.LOG
FC F:\NDCMP\OUT\D27_MA.OUT F:\NDCMP\PUBOUT\D27_MA.OUT >> F:\NDCMP\COMPARE.LOG
FC F:\NDCMP\OUT\D28_MNH.OUT F:\NDCMP\PUBOUT\D28_MNH.OUT >> F:\NDCMP\COMPARE.LOG
FC F:\NDCMP\OUT\D29_MTXT.OUT F:\NDCMP\PUBOUT\D29_MTXT.OUT >> F:\NDCMP\COMPARE.LOG
FC F:\NDCMP\OUT\D30_USRR.OUT F:\NDCMP\PUBOUT\D30_USRR.OUT >> F:\NDCMP\COMPARE.LOG
FC F:\NDCMP\OUT\D31_USRS.OUT F:\NDCMP\PUBOUT\D31_USRS.OUT >> F:\NDCMP\COMPARE.LOG
FC F:\NDCMP\OUT\D32_USRD.OUT F:\NDCMP\PUBOUT\D32_USRD.OUT >> F:\NDCMP\COMPARE.LOG
FC F:\NDCMP\OUT\D33_USRT.OUT F:\NDCMP\PUBOUT\D33_USRT.OUT >> F:\NDCMP\COMPARE.LOG
FC F:\NDCMP\OUT\D34_USRD.OUT F:\NDCMP\PUBOUT\D34_USRD.OUT >> F:\NDCMP\COMPARE.LOG
FC F:\NDCMP\OUT\D90_MISS.OUT F:\NDCMP\PUBOUT\D90_MISS.OUT >> F:\NDCMP\COMPARE.LOG
FC F:\NDCMP\OUT\D99_HELP.OUT F:\NDCMP\PUBOUT\D99_HELP.OUT >> F:\NDCMP\COMPARE.LOG

REM --- Setup NOPASSUSER matrix. ---
ECHO === USER CONTEXT SETUP === >> F:\NDCMP\RUN.LOG
\NPUBLIC\GRANT R F FOR F:\TNDIR TO USER NOPASSUSER > F:\NDCMP\SETUP\S00_ROOT.OUT
\NPUBLIC\GRANT R F FOR F:\TNDIR\URF TO USER NOPASSUSER > F:\NDCMP\SETUP\S10_RF.OUT
\NPUBLIC\GRANT R W C E M F A FOR F:\TNDIR\UFULL TO USER NOPASSUSER > F:\NDCMP\SETUP\S11_FULL.OUT
\NPUBLIC\GRANT S FOR F:\TNDIR\US TO USER NOPASSUSER > F:\NDCMP\SETUP\S12_S.OUT
\NPUBLIC\GRANT N FOR F:\TNDIR\UNONE TO USER NOPASSUSER > F:\NDCMP\SETUP\S13_N.OUT
\NPUBLIC\GRANT R F FOR F:\TNDIR\USUB TO USER NOPASSUSER > F:\NDCMP\SETUP\S14_SUB.OUT
\NPUBLIC\GRANT R F FOR F:\TNDIR\USUB\CHILD TO USER NOPASSUSER > F:\NDCMP\SETUP\S15_CHLD.OUT
\NPUBLIC\GRANT R F FOR F:\TNDIR\MAT TO USER NOPASSUSER > F:\NDCMP\SETUP\S20_MATR.OUT
\NPUBLIC\GRANT R F FOR F:\TNDIR\MAT\D_SUB TO USER NOPASSUSER > F:\NDCMP\SETUP\S21_MSUD.OUT
\NPUBLIC\GRANT R F FOR F:\TNDIR\MAT\D_SUB\CHILD TO USER NOPASSUSER > F:\NDCMP\SETUP\S22_MCHD.OUT
\NPUBLIC\GRANT R F FOR F:\TNDIR\USR TO USER NOPASSUSER > F:\NDCMP\SETUP\S30_USR.OUT
\NPUBLIC\GRANT R FOR F:\TNDIR\USR\U_EVERYR TO GROUP EVERYONE > F:\NDCMP\SETUP\S31_EVR.OUT
\NPUBLIC\GRANT R W C E M F A FOR F:\TNDIR\USR\U_EVERYF TO GROUP EVERYONE > F:\NDCMP\SETUP\S32_EVF.OUT
\NPUBLIC\GRANT R F FOR F:\TNDIR\USR\U_MARIO TO USER MARIO > F:\NDCMP\SETUP\S33_MAR.OUT
\NPUBLIC\GRANT R F FOR F:\TNDIR\USR\U_GUEST TO USER GUEST > F:\NDCMP\SETUP\S34_GST.OUT
\NPUBLIC\GRANT W C M FOR F:\TNDIR\USR\U_NOPWCM TO USER NOPASSUSER > F:\NDCMP\SETUP\S35_WCM.OUT
\NPUBLIC\GRANT R E M A FOR F:\TNDIR\USR\U_NOPREM TO USER NOPASSUSER > F:\NDCMP\SETUP\S36_REM.OUT
\NPUBLIC\GRANT R F FOR F:\TNDIR\USR\U_NOPRF TO USER NOPASSUSER > F:\NDCMP\SETUP\S37_RF.OUT
\NPUBLIC\GRANT R F FOR F:\TNDIR\USR\U_CHILD TO GROUP EVERYONE > F:\NDCMP\SETUP\S38_CHLD.OUT
\NPUBLIC\GRANT S FOR F:\TNDIR\USR\U_CHILD\DEEP TO USER NOPASSUSER > F:\NDCMP\SETUP\S39_DEEP.OUT

REM --- Prepare local delayed helper. ---
MD C:\NDIRTMP
MD C:\NDIRTMP\UNOV
MD C:\NDIRTMP\UPUB
IF EXIST C:\NDIRTMP\HELPER.TXT DEL C:\NDIRTMP\HELPER.TXT
COPY F:\NDIRC.BAT C:\NDIRTMP\NDIRC.BAT > NUL
COPY F:\PUBLIC\DLYSTRT.EXE C:\NDIRTMP\DLYSTRT.EXE > NUL

C:
CD \NDIRTMP
DLYSTRT /T:2 NDIRC.BAT
GOTO END

:PART2
F:
CD \
IF NOT EXIST NDCMP\NUL MD NDCMP
IF NOT EXIST NDCMP\UNOV\NUL MD NDCMP\UNOV
IF NOT EXIST NDCMP\UPUB\NUL MD NDCMP\UPUB
IF NOT EXIST NDCMP\USHORT\NUL MD NDCMP\USHORT
IF NOT EXIST NDCMP\USETUP\NUL MD NDCMP\USETUP

COPY C:\NDIRTMP\UNOV\*.OUT F:\NDCMP\UNOV > NUL
COPY C:\NDIRTMP\UPUB\*.OUT F:\NDCMP\UPUB > NUL
IF EXIST C:\NDIRTMP\USHORT\*.OUT COPY C:\NDIRTMP\USHORT\*.OUT F:\NDCMP\USHORT > NUL
IF EXIST C:\NDIRTMP\HELPER.TXT COPY C:\NDIRTMP\HELPER.TXT F:\NDCMP\HELPER.TXT > NUL
IF EXIST C:\NDIRTMP\UCOMP.LOG COPY C:\NDIRTMP\UCOMP.LOG F:\NDCMP\UCOMP.LOG > NUL

ECHO === SUMMARY === > F:\NDCMP\SUMMARY.TXT
ECHO NDIRTSTA compare test finished. >> F:\NDCMP\SUMMARY.TXT
ECHO. >> F:\NDCMP\SUMMARY.TXT
ECHO Direct output: OUT vs PUBOUT, see COMPARE.LOG. >> F:\NDCMP\SUMMARY.TXT
ECHO User-context output: UNOV vs UPUB, see UCOMP.LOG. >> F:\NDCMP\SUMMARY.TXT
ECHO Public-only /SHORT output: SHORTOUT and USHORT, not compared. >> F:\NDCMP\SUMMARY.TXT
ECHO Matrix coverage: D17-D34 and U17-U30 cover mixed file, directory and user trustee matrices. >> F:\NDCMP\SUMMARY.TXT
ECHO. >> F:\NDCMP\SUMMARY.TXT
ECHO Optional: NDIRZIP ausfuehren. >> F:\NDCMP\SUMMARY.TXT

ECHO.
ECHO NDIRTSTA PART2 fertig.
ECHO Ergebnisse liegen in F:\NDCMP
ECHO Optional: NDIRZIP ausfuehren.
ECHO.
GOTO END

:NEEDPWD
ECHO.
ECHO ERROR: LGNTPWD ist nicht gesetzt.
ECHO.
ECHO Fuer den vollautomatischen NDIR-User-Kontext-Test zuerst setzen, z.B.:
ECHO   SET LGNTPWD=dein-supervisor-passwort
ECHO Danach starten:
ECHO   F:\NDIRTSTA
ECHO.
ECHO Es wurde kein DLYSTRT installiert und kein Login-Test gestartet.
GOTO END

:END
