@ECHO OFF
REM NDIRC.BAT
REM Delayed helper for NDIRTSTA user-context test.

C:
CD \NDIRTMP
IF NOT EXIST C:\NDIRTMP\USHORT\NUL MD C:\NDIRTMP\USHORT

ECHO NDIRC helper started. > C:\NDIRTMP\HELPER.TXT
ECHO Running NOPASSUSER NDIR readback. >> C:\NDIRTMP\HELPER.TXT

LOGOUT > C:\NDIRTMP\D01_LOG.OUT
LOGIN NOPASSUSER > C:\NDIRTMP\D02_LGIN.OUT

F:
CD \

ECHO U10 ROOT as NOPASSUSER >> C:\NDIRTMP\HELPER.TXT
\NPUBLIC\NDIR F:\TNDIR /RIGHTS > C:\NDIRTMP\UNOV\U10_ROOT.OUT
\PUBLIC\NDIR F:\TNDIR /RIGHTS > C:\NDIRTMP\UPUB\U10_ROOT.OUT

ECHO U11 RF as NOPASSUSER >> C:\NDIRTMP\HELPER.TXT
\NPUBLIC\NDIR F:\TNDIR\URF /RIGHTS > C:\NDIRTMP\UNOV\U11_RF.OUT
\PUBLIC\NDIR F:\TNDIR\URF /RIGHTS > C:\NDIRTMP\UPUB\U11_RF.OUT

ECHO U12 FULL as NOPASSUSER >> C:\NDIRTMP\HELPER.TXT
\NPUBLIC\NDIR F:\TNDIR\UFULL /RIGHTS > C:\NDIRTMP\UNOV\U12_FULL.OUT
\PUBLIC\NDIR F:\TNDIR\UFULL /RIGHTS > C:\NDIRTMP\UPUB\U12_FULL.OUT

ECHO U13 S as NOPASSUSER >> C:\NDIRTMP\HELPER.TXT
\NPUBLIC\NDIR F:\TNDIR\US /RIGHTS > C:\NDIRTMP\UNOV\U13_S.OUT
\PUBLIC\NDIR F:\TNDIR\US /RIGHTS > C:\NDIRTMP\UPUB\U13_S.OUT

ECHO U14 N as NOPASSUSER >> C:\NDIRTMP\HELPER.TXT
\NPUBLIC\NDIR F:\TNDIR\UNONE /RIGHTS > C:\NDIRTMP\UNOV\U14_N.OUT
\PUBLIC\NDIR F:\TNDIR\UNONE /RIGHTS > C:\NDIRTMP\UPUB\U14_N.OUT

ECHO U15 SUB as NOPASSUSER >> C:\NDIRTMP\HELPER.TXT
\NPUBLIC\NDIR F:\TNDIR\USUB /SUB /RIGHTS > C:\NDIRTMP\UNOV\U15_SUB.OUT
\PUBLIC\NDIR F:\TNDIR\USUB /SUB /RIGHTS > C:\NDIRTMP\UPUB\U15_SUB.OUT

ECHO U16 wildcard as NOPASSUSER >> C:\NDIRTMP\HELPER.TXT
\NPUBLIC\NDIR F:\TNDIR\*.TXT > C:\NDIRTMP\UNOV\U16_TXT.OUT
\PUBLIC\NDIR F:\TNDIR\*.TXT > C:\NDIRTMP\UPUB\U16_TXT.OUT


ECHO U17 matrix root as NOPASSUSER >> C:\NDIRTMP\HELPER.TXT
\NPUBLIC\NDIR F:\TNDIR\MAT /RIGHTS > C:\NDIRTMP\UNOV\U17_MATR.OUT
\PUBLIC\NDIR F:\TNDIR\MAT /RIGHTS > C:\NDIRTMP\UPUB\U17_MATR.OUT

ECHO U18 matrix dates as NOPASSUSER >> C:\NDIRTMP\HELPER.TXT
\NPUBLIC\NDIR F:\TNDIR\MAT /DATES > C:\NDIRTMP\UNOV\U18_MDAT.OUT
\PUBLIC\NDIR F:\TNDIR\MAT /DATES > C:\NDIRTMP\UPUB\U18_MDAT.OUT

ECHO U19 matrix files only as NOPASSUSER >> C:\NDIRTMP\HELPER.TXT
\NPUBLIC\NDIR F:\TNDIR\MAT /FO > C:\NDIRTMP\UNOV\U19_MFO.OUT
\PUBLIC\NDIR F:\TNDIR\MAT /FO > C:\NDIRTMP\UPUB\U19_MFO.OUT

ECHO U20 matrix dirs only as NOPASSUSER >> C:\NDIRTMP\HELPER.TXT
\NPUBLIC\NDIR F:\TNDIR\MAT /DO > C:\NDIRTMP\UNOV\U20_MDO.OUT
\PUBLIC\NDIR F:\TNDIR\MAT /DO > C:\NDIRTMP\UPUB\U20_MDO.OUT

ECHO U21 matrix sub rights as NOPASSUSER >> C:\NDIRTMP\HELPER.TXT
\NPUBLIC\NDIR F:\TNDIR\MAT /SUB /RIGHTS > C:\NDIRTMP\UNOV\U21_MSUB.OUT
\PUBLIC\NDIR F:\TNDIR\MAT /SUB /RIGHTS > C:\NDIRTMP\UPUB\U21_MSUB.OUT

ECHO U22 matrix hidden filter as NOPASSUSER >> C:\NDIRTMP\HELPER.TXT
\NPUBLIC\NDIR F:\TNDIR\MAT /H > C:\NDIRTMP\UNOV\U22_MH.OUT
\PUBLIC\NDIR F:\TNDIR\MAT /H > C:\NDIRTMP\UPUB\U22_MH.OUT

ECHO U23 matrix wildcard as NOPASSUSER >> C:\NDIRTMP\HELPER.TXT
\NPUBLIC\NDIR F:\TNDIR\MAT\*.TXT > C:\NDIRTMP\UNOV\U23_MTXT.OUT
\PUBLIC\NDIR F:\TNDIR\MAT\*.TXT > C:\NDIRTMP\UPUB\U23_MTXT.OUT

ECHO U24 user matrix rights as NOPASSUSER >> C:\NDIRTMP\HELPER.TXT
\NPUBLIC\NDIR F:\TNDIR\USR /RIGHTS > C:\NDIRTMP\UNOV\U24_USRR.OUT
\PUBLIC\NDIR F:\TNDIR\USR /RIGHTS > C:\NDIRTMP\UPUB\U24_USRR.OUT

ECHO U25 user matrix sub rights as NOPASSUSER >> C:\NDIRTMP\HELPER.TXT
\NPUBLIC\NDIR F:\TNDIR\USR /SUB /RIGHTS > C:\NDIRTMP\UNOV\U25_USRS.OUT
\PUBLIC\NDIR F:\TNDIR\USR /SUB /RIGHTS > C:\NDIRTMP\UPUB\U25_USRS.OUT

ECHO U26 user matrix dirs only rights as NOPASSUSER >> C:\NDIRTMP\HELPER.TXT
\NPUBLIC\NDIR F:\TNDIR\USR /DO /RIGHTS > C:\NDIRTMP\UNOV\U26_USRD.OUT
\PUBLIC\NDIR F:\TNDIR\USR /DO /RIGHTS > C:\NDIRTMP\UPUB\U26_USRD.OUT

ECHO U27 user matrix wildcard as NOPASSUSER >> C:\NDIRTMP\HELPER.TXT
\NPUBLIC\NDIR F:\TNDIR\USR\*.TXT > C:\NDIRTMP\UNOV\U27_USRT.OUT
\PUBLIC\NDIR F:\TNDIR\USR\*.TXT > C:\NDIRTMP\UPUB\U27_USRT.OUT

ECHO U28 user matrix dates as NOPASSUSER >> C:\NDIRTMP\HELPER.TXT
\NPUBLIC\NDIR F:\TNDIR\USR /DATES > C:\NDIRTMP\UNOV\U28_USRD.OUT
\PUBLIC\NDIR F:\TNDIR\USR /DATES > C:\NDIRTMP\UPUB\U28_USRD.OUT

ECHO U29 group EVERYONE view as NOPASSUSER >> C:\NDIRTMP\HELPER.TXT
\NPUBLIC\NDIR F:\TNDIR\USR\U_EVERYF /RIGHTS > C:\NDIRTMP\UNOV\U29_EVRF.OUT
\PUBLIC\NDIR F:\TNDIR\USR\U_EVERYF /RIGHTS > C:\NDIRTMP\UPUB\U29_EVRF.OUT

ECHO U30 NOPASSUSER S child view >> C:\NDIRTMP\HELPER.TXT
\NPUBLIC\NDIR F:\TNDIR\USR\U_CHILD /SUB /RIGHTS > C:\NDIRTMP\UNOV\U30_CHLD.OUT
\PUBLIC\NDIR F:\TNDIR\USR\U_CHILD /SUB /RIGHTS > C:\NDIRTMP\UPUB\U30_CHLD.OUT

ECHO PUBLIC-only /SHORT outputs as NOPASSUSER >> C:\NDIRTMP\HELPER.TXT
\PUBLIC\NDIR F:\TNDIR /RIGHTS /SHORT > C:\NDIRTMP\USHORT\US10_ROOT.OUT
\PUBLIC\NDIR F:\TNDIR\URF /RIGHTS /SHORT > C:\NDIRTMP\USHORT\US11_RF.OUT
\PUBLIC\NDIR F:\TNDIR\USUB /SUB /RIGHTS /SHORT > C:\NDIRTMP\USHORT\US15_SUB.OUT
\PUBLIC\NDIR F:\TNDIR\*.TXT /SHORT > C:\NDIRTMP\USHORT\US16_TXT.OUT
\PUBLIC\NDIR F:\TNDIR\MAT /RIGHTS /SHORT > C:\NDIRTMP\USHORT\US17_MATR.OUT
\PUBLIC\NDIR F:\TNDIR\MAT /SUB /RIGHTS /SHORT > C:\NDIRTMP\USHORT\US21_MSUB.OUT
\PUBLIC\NDIR F:\TNDIR\USR /SUB /RIGHTS /SHORT > C:\NDIRTMP\USHORT\US25_USRS.OUT

ECHO === NDIR USER CONTEXT COMPARE === > C:\NDIRTMP\UCOMP.LOG
FC C:\NDIRTMP\UNOV\U10_ROOT.OUT C:\NDIRTMP\UPUB\U10_ROOT.OUT >> C:\NDIRTMP\UCOMP.LOG
FC C:\NDIRTMP\UNOV\U11_RF.OUT C:\NDIRTMP\UPUB\U11_RF.OUT >> C:\NDIRTMP\UCOMP.LOG
FC C:\NDIRTMP\UNOV\U12_FULL.OUT C:\NDIRTMP\UPUB\U12_FULL.OUT >> C:\NDIRTMP\UCOMP.LOG
FC C:\NDIRTMP\UNOV\U13_S.OUT C:\NDIRTMP\UPUB\U13_S.OUT >> C:\NDIRTMP\UCOMP.LOG
FC C:\NDIRTMP\UNOV\U14_N.OUT C:\NDIRTMP\UPUB\U14_N.OUT >> C:\NDIRTMP\UCOMP.LOG
FC C:\NDIRTMP\UNOV\U15_SUB.OUT C:\NDIRTMP\UPUB\U15_SUB.OUT >> C:\NDIRTMP\UCOMP.LOG
FC C:\NDIRTMP\UNOV\U16_TXT.OUT C:\NDIRTMP\UPUB\U16_TXT.OUT >> C:\NDIRTMP\UCOMP.LOG
FC C:\NDIRTMP\UNOV\U17_MATR.OUT C:\NDIRTMP\UPUB\U17_MATR.OUT >> C:\NDIRTMP\UCOMP.LOG
FC C:\NDIRTMP\UNOV\U18_MDAT.OUT C:\NDIRTMP\UPUB\U18_MDAT.OUT >> C:\NDIRTMP\UCOMP.LOG
FC C:\NDIRTMP\UNOV\U19_MFO.OUT C:\NDIRTMP\UPUB\U19_MFO.OUT >> C:\NDIRTMP\UCOMP.LOG
FC C:\NDIRTMP\UNOV\U20_MDO.OUT C:\NDIRTMP\UPUB\U20_MDO.OUT >> C:\NDIRTMP\UCOMP.LOG
FC C:\NDIRTMP\UNOV\U21_MSUB.OUT C:\NDIRTMP\UPUB\U21_MSUB.OUT >> C:\NDIRTMP\UCOMP.LOG
FC C:\NDIRTMP\UNOV\U22_MH.OUT C:\NDIRTMP\UPUB\U22_MH.OUT >> C:\NDIRTMP\UCOMP.LOG
FC C:\NDIRTMP\UNOV\U23_MTXT.OUT C:\NDIRTMP\UPUB\U23_MTXT.OUT >> C:\NDIRTMP\UCOMP.LOG
FC C:\NDIRTMP\UNOV\U24_USRR.OUT C:\NDIRTMP\UPUB\U24_USRR.OUT >> C:\NDIRTMP\UCOMP.LOG
FC C:\NDIRTMP\UNOV\U25_USRS.OUT C:\NDIRTMP\UPUB\U25_USRS.OUT >> C:\NDIRTMP\UCOMP.LOG
FC C:\NDIRTMP\UNOV\U26_USRD.OUT C:\NDIRTMP\UPUB\U26_USRD.OUT >> C:\NDIRTMP\UCOMP.LOG
FC C:\NDIRTMP\UNOV\U27_USRT.OUT C:\NDIRTMP\UPUB\U27_USRT.OUT >> C:\NDIRTMP\UCOMP.LOG
FC C:\NDIRTMP\UNOV\U28_USRD.OUT C:\NDIRTMP\UPUB\U28_USRD.OUT >> C:\NDIRTMP\UCOMP.LOG
FC C:\NDIRTMP\UNOV\U29_EVRF.OUT C:\NDIRTMP\UPUB\U29_EVRF.OUT >> C:\NDIRTMP\UCOMP.LOG
FC C:\NDIRTMP\UNOV\U30_CHLD.OUT C:\NDIRTMP\UPUB\U30_CHLD.OUT >> C:\NDIRTMP\UCOMP.LOG

LOGOUT > C:\NDIRTMP\D03_LGOT.OUT
F:\LOGIN\LOGIN SUPERVISOR /PWD:%LGNTPWD% > C:\NDIRTMP\D04_LGSU.OUT

F:
CD \
IF EXIST \NDIRTSTA.BAT GOTO HAVEF
ECHO F: wurde nicht wiederhergestellt oder \NDIRTSTA.BAT fehlt. >> C:\NDIRTMP\HELPER.TXT
GOTO END

:HAVEF
C:
CD \NDIRTMP
DLYSTRT /T:2 F:\NDIRTSTA.BAT PART2

:END
