@ECHO OFF
REM RGHTSTA.BAT
REM Automated RIGHTS comparison test for MARS NWE.
REM
REM Direct mode:
REM   OUT     = Novell baseline using \NPUBLIC\RIGHTS
REM   PUBOUT  = our implementation using \PUBLIC\RIGHTS
REM
REM User-context mode:
REM   SUPERVISOR grants mixed rights to NOPASSUSER.
REM   DLYSTRT starts C:\RGHTTMP\RGHTC.BAT after this script exits.
REM   RGHTC logs in as NOPASSUSER and captures RIGHTS output.
REM
REM Optional automatic user-context mode requires:
REM   SET LGNTPWD=your-supervisor-password

IF "%1"=="" GOTO PART1
IF "%1"=="PART2" GOTO PART2
IF "%1"=="part2" GOTO PART2
IF "%1"=="Part2" GOTO PART2
ECHO Usage: RGHTSTA [PART2]
GOTO END

:PART1
F:
CD \

REM --- Clean generated test/result directories. ---
IF EXIST RGHTEST\*.* DELTREE /Y RGHTEST
IF EXIST RGHTCMP\*.* DELTREE /Y RGHTCMP
IF EXIST C:\RGHTTMP\*.* DELTREE /Y C:\RGHTTMP

IF NOT EXIST RGHTEST MD RGHTEST
IF NOT EXIST RGHTEST\SUBDIR MD RGHTEST\SUBDIR
IF NOT EXIST RGHTCMP MD RGHTCMP
IF NOT EXIST RGHTCMP\OUT MD RGHTCMP\OUT
IF NOT EXIST RGHTCMP\PUBOUT MD RGHTCMP\PUBOUT
IF NOT EXIST RGHTCMP\SETUP MD RGHTCMP\SETUP
IF NOT EXIST RGHTCMP\USETUP MD RGHTCMP\USETUP
IF NOT EXIST C:\RGHTTMP MD C:\RGHTTMP
IF NOT EXIST C:\RGHTTMP\UNOV MD C:\RGHTTMP\UNOV
IF NOT EXIST C:\RGHTTMP\UPUB MD C:\RGHTTMP\UPUB

ECHO RIGHTS ROOT FILE > F:\RGHTEST\FILE.TXT
ECHO RIGHTS INNER FILE > F:\RGHTEST\SUBDIR\INNER.TXT

ECHO RGHTSTA RIGHTS comparison test > F:\RGHTCMP\RUN.LOG
ECHO OUT     = Novell baseline with \NPUBLIC\RIGHTS >> F:\RGHTCMP\RUN.LOG
ECHO PUBOUT  = our implementation with \PUBLIC\RIGHTS >> F:\RGHTCMP\RUN.LOG
ECHO UOUT    = user-context output collected by RGHTC. >> F:\RGHTCMP\RUN.LOG
ECHO. >> F:\RGHTCMP\RUN.LOG

ECHO Starting D01_CURR...
ECHO === D01_CURR default/current directory from F:\ === >> F:\RGHTCMP\RUN.LOG
\NPUBLIC\RIGHTS > F:\RGHTCMP\OUT\D01_CURR.OUT
\PUBLIC\RIGHTS > F:\RGHTCMP\PUBOUT\D01_CURR.OUT
ECHO Starting D02_TDIR...
ECHO === D02_TDIR explicit test directory === >> F:\RGHTCMP\RUN.LOG
\NPUBLIC\RIGHTS F:\RGHTEST > F:\RGHTCMP\OUT\D02_TDIR.OUT
\PUBLIC\RIGHTS F:\RGHTEST > F:\RGHTCMP\PUBOUT\D02_TDIR.OUT
ECHO Starting D03_SUBD...
ECHO === D03_SUBD explicit subdirectory === >> F:\RGHTCMP\RUN.LOG
\NPUBLIC\RIGHTS F:\RGHTEST\SUBDIR > F:\RGHTCMP\OUT\D03_SUBD.OUT
\PUBLIC\RIGHTS F:\RGHTEST\SUBDIR > F:\RGHTCMP\PUBOUT\D03_SUBD.OUT
ECHO Starting D04_FILE...
ECHO === D04_FILE explicit file === >> F:\RGHTCMP\RUN.LOG
\NPUBLIC\RIGHTS F:\RGHTEST\FILE.TXT > F:\RGHTCMP\OUT\D04_FILE.OUT
\PUBLIC\RIGHTS F:\RGHTEST\FILE.TXT > F:\RGHTCMP\PUBOUT\D04_FILE.OUT
ECHO Starting D05_INNE...
ECHO === D05_INNE explicit nested file === >> F:\RGHTCMP\RUN.LOG
\NPUBLIC\RIGHTS F:\RGHTEST\SUBDIR\INNER.TXT > F:\RGHTCMP\OUT\D05_INNE.OUT
\PUBLIC\RIGHTS F:\RGHTEST\SUBDIR\INNER.TXT > F:\RGHTCMP\PUBOUT\D05_INNE.OUT
ECHO Starting D06_CURR...
ECHO === D06_CURR default/current directory from F:\RGHTEST === >> F:\RGHTCMP\RUN.LOG
CD \RGHTEST
\NPUBLIC\RIGHTS > F:\RGHTCMP\OUT\D06_CURR.OUT
\PUBLIC\RIGHTS > F:\RGHTCMP\PUBOUT\D06_CURR.OUT
ECHO Starting D07_RELF...
\NPUBLIC\RIGHTS FILE.TXT > F:\RGHTCMP\OUT\D07_RELF.OUT
\PUBLIC\RIGHTS FILE.TXT > F:\RGHTCMP\PUBOUT\D07_RELF.OUT
ECHO Starting D08_RELD...
\NPUBLIC\RIGHTS SUBDIR > F:\RGHTCMP\OUT\D08_RELD.OUT
\PUBLIC\RIGHTS SUBDIR > F:\RGHTCMP\PUBOUT\D08_RELD.OUT
CD \
ECHO Starting D90_MISD...
\NPUBLIC\RIGHTS F:\RGHTEST\MISSING > F:\RGHTCMP\OUT\D90_MISD.OUT
\PUBLIC\RIGHTS F:\RGHTEST\MISSING > F:\RGHTCMP\PUBOUT\D90_MISD.OUT
ECHO Starting D91_MISF...
\NPUBLIC\RIGHTS F:\RGHTEST\NOFILE.TXT > F:\RGHTCMP\OUT\D91_MISF.OUT
\PUBLIC\RIGHTS F:\RGHTEST\NOFILE.TXT > F:\RGHTCMP\PUBOUT\D91_MISF.OUT
ECHO Starting D98_TOOM...
\NPUBLIC\RIGHTS F:\RGHTEST EXTRA > F:\RGHTCMP\OUT\D98_TOOM.OUT
\PUBLIC\RIGHTS F:\RGHTEST EXTRA > F:\RGHTCMP\PUBOUT\D98_TOOM.OUT
ECHO Starting D99_HELP...
\NPUBLIC\RIGHTS /? > F:\RGHTCMP\OUT\D99_HELP.OUT
\PUBLIC\RIGHTS /? > F:\RGHTCMP\PUBOUT\D99_HELP.OUT

ECHO === COMPARE NOVELL OUT AGAINST PUBLIC OUT === > F:\RGHTCMP\COMPARE.LOG
FC F:\RGHTCMP\OUT\D01_CURR.OUT F:\RGHTCMP\PUBOUT\D01_CURR.OUT >> F:\RGHTCMP\COMPARE.LOG
FC F:\RGHTCMP\OUT\D02_TDIR.OUT F:\RGHTCMP\PUBOUT\D02_TDIR.OUT >> F:\RGHTCMP\COMPARE.LOG
FC F:\RGHTCMP\OUT\D03_SUBD.OUT F:\RGHTCMP\PUBOUT\D03_SUBD.OUT >> F:\RGHTCMP\COMPARE.LOG
FC F:\RGHTCMP\OUT\D04_FILE.OUT F:\RGHTCMP\PUBOUT\D04_FILE.OUT >> F:\RGHTCMP\COMPARE.LOG
FC F:\RGHTCMP\OUT\D05_INNE.OUT F:\RGHTCMP\PUBOUT\D05_INNE.OUT >> F:\RGHTCMP\COMPARE.LOG
FC F:\RGHTCMP\OUT\D06_CURR.OUT F:\RGHTCMP\PUBOUT\D06_CURR.OUT >> F:\RGHTCMP\COMPARE.LOG
FC F:\RGHTCMP\OUT\D07_RELF.OUT F:\RGHTCMP\PUBOUT\D07_RELF.OUT >> F:\RGHTCMP\COMPARE.LOG
FC F:\RGHTCMP\OUT\D08_RELD.OUT F:\RGHTCMP\PUBOUT\D08_RELD.OUT >> F:\RGHTCMP\COMPARE.LOG
FC F:\RGHTCMP\OUT\D90_MISD.OUT F:\RGHTCMP\PUBOUT\D90_MISD.OUT >> F:\RGHTCMP\COMPARE.LOG
FC F:\RGHTCMP\OUT\D91_MISF.OUT F:\RGHTCMP\PUBOUT\D91_MISF.OUT >> F:\RGHTCMP\COMPARE.LOG
FC F:\RGHTCMP\OUT\D98_TOOM.OUT F:\RGHTCMP\PUBOUT\D98_TOOM.OUT >> F:\RGHTCMP\COMPARE.LOG
FC F:\RGHTCMP\OUT\D99_HELP.OUT F:\RGHTCMP\PUBOUT\D99_HELP.OUT >> F:\RGHTCMP\COMPARE.LOG
ECHO. >> F:\RGHTCMP\COMPARE.LOG

ECHO Preparing NOPASSUSER rights matrix...
ECHO === USER-CONTEXT RIGHTS MATRIX SETUP === >> F:\RGHTCMP\RUN.LOG
ECHO Setup U10_R = R...
IF NOT EXIST RGHTEST\U10 MD RGHTEST\U10
ECHO U10_R > F:\RGHTEST\U10\FILE.TXT
\NPUBLIC\REMOVE USER NOPASSUSER FROM F:\RGHTEST\U10 > F:\RGHTCMP\USETUP\U10_R.REM
\NPUBLIC\GRANT R FOR F:\RGHTEST\U10 TO USER NOPASSUSER > F:\RGHTCMP\USETUP\U10_R.GRN
ECHO Setup U11_W = W...
IF NOT EXIST RGHTEST\U11 MD RGHTEST\U11
ECHO U11_W > F:\RGHTEST\U11\FILE.TXT
\NPUBLIC\REMOVE USER NOPASSUSER FROM F:\RGHTEST\U11 > F:\RGHTCMP\USETUP\U11_W.REM
\NPUBLIC\GRANT W FOR F:\RGHTEST\U11 TO USER NOPASSUSER > F:\RGHTCMP\USETUP\U11_W.GRN
ECHO Setup U12_C = C...
IF NOT EXIST RGHTEST\U12 MD RGHTEST\U12
ECHO U12_C > F:\RGHTEST\U12\FILE.TXT
\NPUBLIC\REMOVE USER NOPASSUSER FROM F:\RGHTEST\U12 > F:\RGHTCMP\USETUP\U12_C.REM
\NPUBLIC\GRANT C FOR F:\RGHTEST\U12 TO USER NOPASSUSER > F:\RGHTCMP\USETUP\U12_C.GRN
ECHO Setup U13_E = E...
IF NOT EXIST RGHTEST\U13 MD RGHTEST\U13
ECHO U13_E > F:\RGHTEST\U13\FILE.TXT
\NPUBLIC\REMOVE USER NOPASSUSER FROM F:\RGHTEST\U13 > F:\RGHTCMP\USETUP\U13_E.REM
\NPUBLIC\GRANT E FOR F:\RGHTEST\U13 TO USER NOPASSUSER > F:\RGHTCMP\USETUP\U13_E.GRN
ECHO Setup U14_M = M...
IF NOT EXIST RGHTEST\U14 MD RGHTEST\U14
ECHO U14_M > F:\RGHTEST\U14\FILE.TXT
\NPUBLIC\REMOVE USER NOPASSUSER FROM F:\RGHTEST\U14 > F:\RGHTCMP\USETUP\U14_M.REM
\NPUBLIC\GRANT M FOR F:\RGHTEST\U14 TO USER NOPASSUSER > F:\RGHTCMP\USETUP\U14_M.GRN
ECHO Setup U15_F = F...
IF NOT EXIST RGHTEST\U15 MD RGHTEST\U15
ECHO U15_F > F:\RGHTEST\U15\FILE.TXT
\NPUBLIC\REMOVE USER NOPASSUSER FROM F:\RGHTEST\U15 > F:\RGHTCMP\USETUP\U15_F.REM
\NPUBLIC\GRANT F FOR F:\RGHTEST\U15 TO USER NOPASSUSER > F:\RGHTCMP\USETUP\U15_F.GRN
ECHO Setup U16_A = A...
IF NOT EXIST RGHTEST\U16 MD RGHTEST\U16
ECHO U16_A > F:\RGHTEST\U16\FILE.TXT
\NPUBLIC\REMOVE USER NOPASSUSER FROM F:\RGHTEST\U16 > F:\RGHTCMP\USETUP\U16_A.REM
\NPUBLIC\GRANT A FOR F:\RGHTEST\U16 TO USER NOPASSUSER > F:\RGHTCMP\USETUP\U16_A.GRN
ECHO Setup U17_S = S...
IF NOT EXIST RGHTEST\U17 MD RGHTEST\U17
ECHO U17_S > F:\RGHTEST\U17\FILE.TXT
\NPUBLIC\REMOVE USER NOPASSUSER FROM F:\RGHTEST\U17 > F:\RGHTCMP\USETUP\U17_S.REM
\NPUBLIC\GRANT S FOR F:\RGHTEST\U17 TO USER NOPASSUSER > F:\RGHTCMP\USETUP\U17_S.GRN
ECHO Setup U20_RF = R F...
IF NOT EXIST RGHTEST\U20 MD RGHTEST\U20
ECHO U20_RF > F:\RGHTEST\U20\FILE.TXT
\NPUBLIC\REMOVE USER NOPASSUSER FROM F:\RGHTEST\U20 > F:\RGHTCMP\USETUP\U20_RF.REM
\NPUBLIC\GRANT R F FOR F:\RGHTEST\U20 TO USER NOPASSUSER > F:\RGHTCMP\USETUP\U20_RF.GRN
ECHO Setup U21_RW = R W...
IF NOT EXIST RGHTEST\U21 MD RGHTEST\U21
ECHO U21_RW > F:\RGHTEST\U21\FILE.TXT
\NPUBLIC\REMOVE USER NOPASSUSER FROM F:\RGHTEST\U21 > F:\RGHTCMP\USETUP\U21_RW.REM
\NPUBLIC\GRANT R W FOR F:\RGHTEST\U21 TO USER NOPASSUSER > F:\RGHTCMP\USETUP\U21_RW.GRN
ECHO Setup U22_RWC = R W C...
IF NOT EXIST RGHTEST\U22 MD RGHTEST\U22
ECHO U22_RWC > F:\RGHTEST\U22\FILE.TXT
\NPUBLIC\REMOVE USER NOPASSUSER FROM F:\RGHTEST\U22 > F:\RGHTCMP\USETUP\U22_RWC.REM
\NPUBLIC\GRANT R W C FOR F:\RGHTEST\U22 TO USER NOPASSUSER > F:\RGHTCMP\USETUP\U22_RWC.GRN
ECHO Setup U23_RWCE = R W C E...
IF NOT EXIST RGHTEST\U23 MD RGHTEST\U23
ECHO U23_RWCE > F:\RGHTEST\U23\FILE.TXT
\NPUBLIC\REMOVE USER NOPASSUSER FROM F:\RGHTEST\U23 > F:\RGHTCMP\USETUP\U23_RWCE.REM
\NPUBLIC\GRANT R W C E FOR F:\RGHTEST\U23 TO USER NOPASSUSER > F:\RGHTCMP\USETUP\U23_RWCE.GRN
ECHO Setup U24_RAL = R W C E M F A...
IF NOT EXIST RGHTEST\U24 MD RGHTEST\U24
ECHO U24_RAL > F:\RGHTEST\U24\FILE.TXT
\NPUBLIC\REMOVE USER NOPASSUSER FROM F:\RGHTEST\U24 > F:\RGHTCMP\USETUP\U24_RAL.REM
\NPUBLIC\GRANT R W C E M F A FOR F:\RGHTEST\U24 TO USER NOPASSUSER > F:\RGHTCMP\USETUP\U24_RAL.GRN
ECHO Setup U25_SAL = S R W C E M F A...
IF NOT EXIST RGHTEST\U25 MD RGHTEST\U25
ECHO U25_SAL > F:\RGHTEST\U25\FILE.TXT
\NPUBLIC\REMOVE USER NOPASSUSER FROM F:\RGHTEST\U25 > F:\RGHTCMP\USETUP\U25_SAL.REM
\NPUBLIC\GRANT S R W C E M F A FOR F:\RGHTEST\U25 TO USER NOPASSUSER > F:\RGHTCMP\USETUP\U25_SAL.GRN
ECHO Setup U26_ALL = ALL...
IF NOT EXIST RGHTEST\U26 MD RGHTEST\U26
ECHO U26_ALL > F:\RGHTEST\U26\FILE.TXT
\NPUBLIC\REMOVE USER NOPASSUSER FROM F:\RGHTEST\U26 > F:\RGHTCMP\USETUP\U26_ALL.REM
\NPUBLIC\GRANT ALL FOR F:\RGHTEST\U26 TO USER NOPASSUSER > F:\RGHTCMP\USETUP\U26_ALL.GRN
ECHO Setup U27_N = N...
IF NOT EXIST RGHTEST\U27 MD RGHTEST\U27
ECHO U27_N > F:\RGHTEST\U27\FILE.TXT
\NPUBLIC\REMOVE USER NOPASSUSER FROM F:\RGHTEST\U27 > F:\RGHTCMP\USETUP\U27_N.REM
\NPUBLIC\GRANT N FOR F:\RGHTEST\U27 TO USER NOPASSUSER > F:\RGHTCMP\USETUP\U27_N.GRN
ECHO Setup U30_RE = R E...
IF NOT EXIST RGHTEST\U30 MD RGHTEST\U30
ECHO U30_RE > F:\RGHTEST\U30\FILE.TXT
\NPUBLIC\REMOVE USER NOPASSUSER FROM F:\RGHTEST\U30 > F:\RGHTCMP\USETUP\U30_RE.REM
\NPUBLIC\GRANT R E FOR F:\RGHTEST\U30 TO USER NOPASSUSER > F:\RGHTCMP\USETUP\U30_RE.GRN
ECHO Setup U31_RWF = R W F...
IF NOT EXIST RGHTEST\U31 MD RGHTEST\U31
ECHO U31_RWF > F:\RGHTEST\U31\FILE.TXT
\NPUBLIC\REMOVE USER NOPASSUSER FROM F:\RGHTEST\U31 > F:\RGHTCMP\USETUP\U31_RWF.REM
\NPUBLIC\GRANT R W F FOR F:\RGHTEST\U31 TO USER NOPASSUSER > F:\RGHTCMP\USETUP\U31_RWF.GRN
ECHO Setup U32_RCM = R C M...
IF NOT EXIST RGHTEST\U32 MD RGHTEST\U32
ECHO U32_RCM > F:\RGHTEST\U32\FILE.TXT
\NPUBLIC\REMOVE USER NOPASSUSER FROM F:\RGHTEST\U32 > F:\RGHTCMP\USETUP\U32_RCM.REM
\NPUBLIC\GRANT R C M FOR F:\RGHTEST\U32 TO USER NOPASSUSER > F:\RGHTCMP\USETUP\U32_RCM.GRN
ECHO Setup U33_RFA = R F A...
IF NOT EXIST RGHTEST\U33 MD RGHTEST\U33
ECHO U33_RFA > F:\RGHTEST\U33\FILE.TXT
\NPUBLIC\REMOVE USER NOPASSUSER FROM F:\RGHTEST\U33 > F:\RGHTCMP\USETUP\U33_RFA.REM
\NPUBLIC\GRANT R F A FOR F:\RGHTEST\U33 TO USER NOPASSUSER > F:\RGHTCMP\USETUP\U33_RFA.GRN
ECHO Setup U34_WCM = W C M...
IF NOT EXIST RGHTEST\U34 MD RGHTEST\U34
ECHO U34_WCM > F:\RGHTEST\U34\FILE.TXT
\NPUBLIC\REMOVE USER NOPASSUSER FROM F:\RGHTEST\U34 > F:\RGHTCMP\USETUP\U34_WCM.REM
\NPUBLIC\GRANT W C M FOR F:\RGHTEST\U34 TO USER NOPASSUSER > F:\RGHTCMP\USETUP\U34_WCM.GRN
ECHO Setup U35_EMF = E M F...
IF NOT EXIST RGHTEST\U35 MD RGHTEST\U35
ECHO U35_EMF > F:\RGHTEST\U35\FILE.TXT
\NPUBLIC\REMOVE USER NOPASSUSER FROM F:\RGHTEST\U35 > F:\RGHTCMP\USETUP\U35_EMF.REM
\NPUBLIC\GRANT E M F FOR F:\RGHTEST\U35 TO USER NOPASSUSER > F:\RGHTCMP\USETUP\U35_EMF.GRN
ECHO Setup U36_RMF = R W C M F...
IF NOT EXIST RGHTEST\U36 MD RGHTEST\U36
ECHO U36_RMF > F:\RGHTEST\U36\FILE.TXT
\NPUBLIC\REMOVE USER NOPASSUSER FROM F:\RGHTEST\U36 > F:\RGHTCMP\USETUP\U36_RMF.REM
\NPUBLIC\GRANT R W C M F FOR F:\RGHTEST\U36 TO USER NOPASSUSER > F:\RGHTCMP\USETUP\U36_RMF.GRN
ECHO Setup U37_REMA = R E M A...
IF NOT EXIST RGHTEST\U37 MD RGHTEST\U37
ECHO U37_REMA > F:\RGHTEST\U37\FILE.TXT
\NPUBLIC\REMOVE USER NOPASSUSER FROM F:\RGHTEST\U37 > F:\RGHTCMP\USETUP\U37_REMA.REM
\NPUBLIC\GRANT R E M A FOR F:\RGHTEST\U37 TO USER NOPASSUSER > F:\RGHTCMP\USETUP\U37_REMA.GRN
ECHO Setup U38_SR = S R...
IF NOT EXIST RGHTEST\U38 MD RGHTEST\U38
ECHO U38_SR > F:\RGHTEST\U38\FILE.TXT
\NPUBLIC\REMOVE USER NOPASSUSER FROM F:\RGHTEST\U38 > F:\RGHTCMP\USETUP\U38_SR.REM
\NPUBLIC\GRANT S R FOR F:\RGHTEST\U38 TO USER NOPASSUSER > F:\RGHTCMP\USETUP\U38_SR.GRN
ECHO Setup U39_SRF = S R F...
IF NOT EXIST RGHTEST\U39 MD RGHTEST\U39
ECHO U39_SRF > F:\RGHTEST\U39\FILE.TXT
\NPUBLIC\REMOVE USER NOPASSUSER FROM F:\RGHTEST\U39 > F:\RGHTCMP\USETUP\U39_SRF.REM
\NPUBLIC\GRANT S R F FOR F:\RGHTEST\U39 TO USER NOPASSUSER > F:\RGHTCMP\USETUP\U39_SRF.GRN
ECHO Setup U40_SWCM = S W C M...
IF NOT EXIST RGHTEST\U40 MD RGHTEST\U40
ECHO U40_SWCM > F:\RGHTEST\U40\FILE.TXT
\NPUBLIC\REMOVE USER NOPASSUSER FROM F:\RGHTEST\U40 > F:\RGHTCMP\USETUP\U40_SWCM.REM
\NPUBLIC\GRANT S W C M FOR F:\RGHTEST\U40 TO USER NOPASSUSER > F:\RGHTCMP\USETUP\U40_SWCM.GRN
ECHO Setup F10_R = R /FILES...
IF NOT EXIST RGHTEST\UF10 MD RGHTEST\UF10
ECHO F10_R > F:\RGHTEST\UF10\F.TXT
\NPUBLIC\REMOVE USER NOPASSUSER FROM F:\RGHTEST\UF10\F.TXT > F:\RGHTCMP\USETUP\F10_R.REM
\NPUBLIC\GRANT R FOR F:\RGHTEST\UF10\F.TXT TO USER NOPASSUSER /FILES > F:\RGHTCMP\USETUP\F10_R.GRN
ECHO Setup F11_RF = R F /FILES...
IF NOT EXIST RGHTEST\UF11 MD RGHTEST\UF11
ECHO F11_RF > F:\RGHTEST\UF11\F.TXT
\NPUBLIC\REMOVE USER NOPASSUSER FROM F:\RGHTEST\UF11\F.TXT > F:\RGHTCMP\USETUP\F11_RF.REM
\NPUBLIC\GRANT R F FOR F:\RGHTEST\UF11\F.TXT TO USER NOPASSUSER /FILES > F:\RGHTCMP\USETUP\F11_RF.GRN
ECHO Setup F12_RAL = R W C E M F A /FILES...
IF NOT EXIST RGHTEST\UF12 MD RGHTEST\UF12
ECHO F12_RAL > F:\RGHTEST\UF12\F.TXT
\NPUBLIC\REMOVE USER NOPASSUSER FROM F:\RGHTEST\UF12\F.TXT > F:\RGHTCMP\USETUP\F12_RAL.REM
\NPUBLIC\GRANT R W C E M F A FOR F:\RGHTEST\UF12\F.TXT TO USER NOPASSUSER /FILES > F:\RGHTCMP\USETUP\F12_RAL.GRN
ECHO Setup F13_ALL = ALL /FILES...
IF NOT EXIST RGHTEST\UF13 MD RGHTEST\UF13
ECHO F13_ALL > F:\RGHTEST\UF13\F.TXT
\NPUBLIC\REMOVE USER NOPASSUSER FROM F:\RGHTEST\UF13\F.TXT > F:\RGHTCMP\USETUP\F13_ALL.REM
\NPUBLIC\GRANT ALL FOR F:\RGHTEST\UF13\F.TXT TO USER NOPASSUSER /FILES > F:\RGHTCMP\USETUP\F13_ALL.GRN
ECHO Setup F14_N = N /FILES...
IF NOT EXIST RGHTEST\UF14 MD RGHTEST\UF14
ECHO F14_N > F:\RGHTEST\UF14\F.TXT
\NPUBLIC\REMOVE USER NOPASSUSER FROM F:\RGHTEST\UF14\F.TXT > F:\RGHTCMP\USETUP\F14_N.REM
\NPUBLIC\GRANT N FOR F:\RGHTEST\UF14\F.TXT TO USER NOPASSUSER /FILES > F:\RGHTCMP\USETUP\F14_N.GRN
ECHO Setup F15_S = S /FILES...
IF NOT EXIST RGHTEST\UF15 MD RGHTEST\UF15
ECHO F15_S > F:\RGHTEST\UF15\F.TXT
\NPUBLIC\REMOVE USER NOPASSUSER FROM F:\RGHTEST\UF15\F.TXT > F:\RGHTCMP\USETUP\F15_S.REM
\NPUBLIC\GRANT S FOR F:\RGHTEST\UF15\F.TXT TO USER NOPASSUSER /FILES > F:\RGHTCMP\USETUP\F15_S.GRN
ECHO Setup F16_SAL = S R W C E M F A /FILES...
IF NOT EXIST RGHTEST\UF16 MD RGHTEST\UF16
ECHO F16_SAL > F:\RGHTEST\UF16\F.TXT
\NPUBLIC\REMOVE USER NOPASSUSER FROM F:\RGHTEST\UF16\F.TXT > F:\RGHTCMP\USETUP\F16_SAL.REM
\NPUBLIC\GRANT S R W C E M F A FOR F:\RGHTEST\UF16\F.TXT TO USER NOPASSUSER /FILES > F:\RGHTCMP\USETUP\F16_SAL.GRN

IF "%LGNTPWD%"=="" GOTO SKIPUSER
ECHO Installing delayed user-context helper...
IF NOT EXIST C:\RGHTTMP MD C:\RGHTTMP
IF NOT EXIST C:\RGHTTMP\UNOV MD C:\RGHTTMP\UNOV
IF NOT EXIST C:\RGHTTMP\UPUB MD C:\RGHTTMP\UPUB
COPY F:\RGHTC.BAT C:\RGHTTMP\RGHTC.BAT > F:\RGHTCMP\RGHTC.CPY
COPY \PUBLIC\DLYSTRT.EXE C:\RGHTTMP\DLYSTRT.EXE > F:\RGHTCMP\DLY.CPY
C:
CD \RGHTTMP
DLYSTRT /T:2 RGHTC.BAT
ECHO RGHTSTA part 1 finished. RGHTC will run delayed from C:\RGHTTMP.
GOTO END

:SKIPUSER
ECHO LGNTPWD is not set. User-context matrix was not started.
ECHO Set LGNTPWD and run RGHTSTA again for the automatic NOPASSUSER matrix.
ECHO LGNTPWD not set; user-context matrix skipped. >> F:\RGHTCMP\SUMMARY.TXT
GOTO WRITESUM

:WRITESUM
ECHO === SUMMARY === > F:\RGHTCMP\SUMMARY.TXT
ECHO RGHTSTA direct RIGHTS comparison finished. >> F:\RGHTCMP\SUMMARY.TXT
ECHO User-context matrix requires LGNTPWD. >> F:\RGHTCMP\SUMMARY.TXT
ECHO Optional: RGHTZIP ausfuehren. >> F:\RGHTCMP\SUMMARY.TXT
GOTO END

:PART2
F:
CD \
IF NOT EXIST RGHTCMP MD RGHTCMP
IF NOT EXIST RGHTCMP\UNOV MD RGHTCMP\UNOV
IF NOT EXIST RGHTCMP\UPUB MD RGHTCMP\UPUB
COPY C:\RGHTTMP\UNOV\*.OUT F:\RGHTCMP\UNOV > F:\RGHTCMP\UPART2.LOG
COPY C:\RGHTTMP\UPUB\*.OUT F:\RGHTCMP\UPUB >> F:\RGHTCMP\UPART2.LOG
COPY C:\RGHTTMP\*.OUT F:\RGHTCMP >> F:\RGHTCMP\UPART2.LOG
COPY C:\RGHTTMP\HELPER.TXT F:\RGHTCMP >> F:\RGHTCMP\UPART2.LOG
ECHO === USER-CONTEXT COMPARE NOVELL AGAINST PUBLIC === > F:\RGHTCMP\UCOMPARE.LOG
FC F:\RGHTCMP\UNOV\U10_R.OUT F:\RGHTCMP\UPUB\U10_R.OUT >> F:\RGHTCMP\UCOMPARE.LOG
FC F:\RGHTCMP\UNOV\U11_W.OUT F:\RGHTCMP\UPUB\U11_W.OUT >> F:\RGHTCMP\UCOMPARE.LOG
FC F:\RGHTCMP\UNOV\U12_C.OUT F:\RGHTCMP\UPUB\U12_C.OUT >> F:\RGHTCMP\UCOMPARE.LOG
FC F:\RGHTCMP\UNOV\U13_E.OUT F:\RGHTCMP\UPUB\U13_E.OUT >> F:\RGHTCMP\UCOMPARE.LOG
FC F:\RGHTCMP\UNOV\U14_M.OUT F:\RGHTCMP\UPUB\U14_M.OUT >> F:\RGHTCMP\UCOMPARE.LOG
FC F:\RGHTCMP\UNOV\U15_F.OUT F:\RGHTCMP\UPUB\U15_F.OUT >> F:\RGHTCMP\UCOMPARE.LOG
FC F:\RGHTCMP\UNOV\U16_A.OUT F:\RGHTCMP\UPUB\U16_A.OUT >> F:\RGHTCMP\UCOMPARE.LOG
FC F:\RGHTCMP\UNOV\U17_S.OUT F:\RGHTCMP\UPUB\U17_S.OUT >> F:\RGHTCMP\UCOMPARE.LOG
FC F:\RGHTCMP\UNOV\U20_RF.OUT F:\RGHTCMP\UPUB\U20_RF.OUT >> F:\RGHTCMP\UCOMPARE.LOG
FC F:\RGHTCMP\UNOV\U21_RW.OUT F:\RGHTCMP\UPUB\U21_RW.OUT >> F:\RGHTCMP\UCOMPARE.LOG
FC F:\RGHTCMP\UNOV\U22_RWC.OUT F:\RGHTCMP\UPUB\U22_RWC.OUT >> F:\RGHTCMP\UCOMPARE.LOG
FC F:\RGHTCMP\UNOV\U23_RWCE.OUT F:\RGHTCMP\UPUB\U23_RWCE.OUT >> F:\RGHTCMP\UCOMPARE.LOG
FC F:\RGHTCMP\UNOV\U24_RAL.OUT F:\RGHTCMP\UPUB\U24_RAL.OUT >> F:\RGHTCMP\UCOMPARE.LOG
FC F:\RGHTCMP\UNOV\U25_SAL.OUT F:\RGHTCMP\UPUB\U25_SAL.OUT >> F:\RGHTCMP\UCOMPARE.LOG
FC F:\RGHTCMP\UNOV\U26_ALL.OUT F:\RGHTCMP\UPUB\U26_ALL.OUT >> F:\RGHTCMP\UCOMPARE.LOG
FC F:\RGHTCMP\UNOV\U27_N.OUT F:\RGHTCMP\UPUB\U27_N.OUT >> F:\RGHTCMP\UCOMPARE.LOG
FC F:\RGHTCMP\UNOV\U30_RE.OUT F:\RGHTCMP\UPUB\U30_RE.OUT >> F:\RGHTCMP\UCOMPARE.LOG
FC F:\RGHTCMP\UNOV\U31_RWF.OUT F:\RGHTCMP\UPUB\U31_RWF.OUT >> F:\RGHTCMP\UCOMPARE.LOG
FC F:\RGHTCMP\UNOV\U32_RCM.OUT F:\RGHTCMP\UPUB\U32_RCM.OUT >> F:\RGHTCMP\UCOMPARE.LOG
FC F:\RGHTCMP\UNOV\U33_RFA.OUT F:\RGHTCMP\UPUB\U33_RFA.OUT >> F:\RGHTCMP\UCOMPARE.LOG
FC F:\RGHTCMP\UNOV\U34_WCM.OUT F:\RGHTCMP\UPUB\U34_WCM.OUT >> F:\RGHTCMP\UCOMPARE.LOG
FC F:\RGHTCMP\UNOV\U35_EMF.OUT F:\RGHTCMP\UPUB\U35_EMF.OUT >> F:\RGHTCMP\UCOMPARE.LOG
FC F:\RGHTCMP\UNOV\U36_RMF.OUT F:\RGHTCMP\UPUB\U36_RMF.OUT >> F:\RGHTCMP\UCOMPARE.LOG
FC F:\RGHTCMP\UNOV\U37_REMA.OUT F:\RGHTCMP\UPUB\U37_REMA.OUT >> F:\RGHTCMP\UCOMPARE.LOG
FC F:\RGHTCMP\UNOV\U38_SR.OUT F:\RGHTCMP\UPUB\U38_SR.OUT >> F:\RGHTCMP\UCOMPARE.LOG
FC F:\RGHTCMP\UNOV\U39_SRF.OUT F:\RGHTCMP\UPUB\U39_SRF.OUT >> F:\RGHTCMP\UCOMPARE.LOG
FC F:\RGHTCMP\UNOV\U40_SWCM.OUT F:\RGHTCMP\UPUB\U40_SWCM.OUT >> F:\RGHTCMP\UCOMPARE.LOG
FC F:\RGHTCMP\UNOV\F10_R.OUT F:\RGHTCMP\UPUB\F10_R.OUT >> F:\RGHTCMP\UCOMPARE.LOG
FC F:\RGHTCMP\UNOV\F11_RF.OUT F:\RGHTCMP\UPUB\F11_RF.OUT >> F:\RGHTCMP\UCOMPARE.LOG
FC F:\RGHTCMP\UNOV\F12_RAL.OUT F:\RGHTCMP\UPUB\F12_RAL.OUT >> F:\RGHTCMP\UCOMPARE.LOG
FC F:\RGHTCMP\UNOV\F13_ALL.OUT F:\RGHTCMP\UPUB\F13_ALL.OUT >> F:\RGHTCMP\UCOMPARE.LOG
FC F:\RGHTCMP\UNOV\F14_N.OUT F:\RGHTCMP\UPUB\F14_N.OUT >> F:\RGHTCMP\UCOMPARE.LOG
FC F:\RGHTCMP\UNOV\F15_S.OUT F:\RGHTCMP\UPUB\F15_S.OUT >> F:\RGHTCMP\UCOMPARE.LOG
FC F:\RGHTCMP\UNOV\F16_SAL.OUT F:\RGHTCMP\UPUB\F16_SAL.OUT >> F:\RGHTCMP\UCOMPARE.LOG
ECHO === SUMMARY === > F:\RGHTCMP\SUMMARY.TXT
ECHO RGHTSTA RIGHTS comparison finished. >> F:\RGHTCMP\SUMMARY.TXT
ECHO. >> F:\RGHTCMP\SUMMARY.TXT
ECHO OUT/PUBOUT compare direct SUPERVISOR output. >> F:\RGHTCMP\SUMMARY.TXT
ECHO UNOV/UPUB compare effective RIGHTS as NOPASSUSER. >> F:\RGHTCMP\SUMMARY.TXT
ECHO USETUP contains GRANT/REMOVE setup output. >> F:\RGHTCMP\SUMMARY.TXT
ECHO. >> F:\RGHTCMP\SUMMARY.TXT
ECHO Optional: RGHTZIP ausfuehren. >> F:\RGHTCMP\SUMMARY.TXT
ECHO RGHTSTA PART2 fertig.
ECHO Ergebnisse liegen in F:\RGHTCMP
ECHO Optional: RGHTZIP ausfuehren.
GOTO END

:END
