@ECHO OFF
REM RGHTC.BAT - delayed user-context RIGHTS capture helper.
REM Started by RGHTSTA via DLYSTRT. Runs from C:\RGHTTMP.

C:
CD \RGHTTMP

ECHO RGHTC user-context RIGHTS helper > HELPER.TXT
ECHO Current phase: logout supervisor, login NOPASSUSER. >> HELPER.TXT

LOGOUT > ULOG1.OUT
LOGIN NOPASSUSER > ULOGIN.OUT

F:
CD \
IF EXIST \NPUBLIC\RIGHTS.EXE GOTO HAVEF
ECHO F: not ready after NOPASSUSER login. >> C:\RGHTTMP\HELPER.TXT
GOTO RELSUP

:HAVEF
ECHO Starting U10_R as NOPASSUSER... >> C:\RGHTTMP\HELPER.TXT
\NPUBLIC\RIGHTS F:\RGHTEST\U10 > C:\RGHTTMP\UNOV\U10_R.OUT
\PUBLIC\RIGHTS F:\RGHTEST\U10 > C:\RGHTTMP\UPUB\U10_R.OUT
ECHO Starting U11_W as NOPASSUSER... >> C:\RGHTTMP\HELPER.TXT
\NPUBLIC\RIGHTS F:\RGHTEST\U11 > C:\RGHTTMP\UNOV\U11_W.OUT
\PUBLIC\RIGHTS F:\RGHTEST\U11 > C:\RGHTTMP\UPUB\U11_W.OUT
ECHO Starting U12_C as NOPASSUSER... >> C:\RGHTTMP\HELPER.TXT
\NPUBLIC\RIGHTS F:\RGHTEST\U12 > C:\RGHTTMP\UNOV\U12_C.OUT
\PUBLIC\RIGHTS F:\RGHTEST\U12 > C:\RGHTTMP\UPUB\U12_C.OUT
ECHO Starting U13_E as NOPASSUSER... >> C:\RGHTTMP\HELPER.TXT
\NPUBLIC\RIGHTS F:\RGHTEST\U13 > C:\RGHTTMP\UNOV\U13_E.OUT
\PUBLIC\RIGHTS F:\RGHTEST\U13 > C:\RGHTTMP\UPUB\U13_E.OUT
ECHO Starting U14_M as NOPASSUSER... >> C:\RGHTTMP\HELPER.TXT
\NPUBLIC\RIGHTS F:\RGHTEST\U14 > C:\RGHTTMP\UNOV\U14_M.OUT
\PUBLIC\RIGHTS F:\RGHTEST\U14 > C:\RGHTTMP\UPUB\U14_M.OUT
ECHO Starting U15_F as NOPASSUSER... >> C:\RGHTTMP\HELPER.TXT
\NPUBLIC\RIGHTS F:\RGHTEST\U15 > C:\RGHTTMP\UNOV\U15_F.OUT
\PUBLIC\RIGHTS F:\RGHTEST\U15 > C:\RGHTTMP\UPUB\U15_F.OUT
ECHO Starting U16_A as NOPASSUSER... >> C:\RGHTTMP\HELPER.TXT
\NPUBLIC\RIGHTS F:\RGHTEST\U16 > C:\RGHTTMP\UNOV\U16_A.OUT
\PUBLIC\RIGHTS F:\RGHTEST\U16 > C:\RGHTTMP\UPUB\U16_A.OUT
ECHO Starting U17_S as NOPASSUSER... >> C:\RGHTTMP\HELPER.TXT
\NPUBLIC\RIGHTS F:\RGHTEST\U17 > C:\RGHTTMP\UNOV\U17_S.OUT
\PUBLIC\RIGHTS F:\RGHTEST\U17 > C:\RGHTTMP\UPUB\U17_S.OUT
ECHO Starting U20_RF as NOPASSUSER... >> C:\RGHTTMP\HELPER.TXT
\NPUBLIC\RIGHTS F:\RGHTEST\U20 > C:\RGHTTMP\UNOV\U20_RF.OUT
\PUBLIC\RIGHTS F:\RGHTEST\U20 > C:\RGHTTMP\UPUB\U20_RF.OUT
ECHO Starting U21_RW as NOPASSUSER... >> C:\RGHTTMP\HELPER.TXT
\NPUBLIC\RIGHTS F:\RGHTEST\U21 > C:\RGHTTMP\UNOV\U21_RW.OUT
\PUBLIC\RIGHTS F:\RGHTEST\U21 > C:\RGHTTMP\UPUB\U21_RW.OUT
ECHO Starting U22_RWC as NOPASSUSER... >> C:\RGHTTMP\HELPER.TXT
\NPUBLIC\RIGHTS F:\RGHTEST\U22 > C:\RGHTTMP\UNOV\U22_RWC.OUT
\PUBLIC\RIGHTS F:\RGHTEST\U22 > C:\RGHTTMP\UPUB\U22_RWC.OUT
ECHO Starting U23_RWCE as NOPASSUSER... >> C:\RGHTTMP\HELPER.TXT
\NPUBLIC\RIGHTS F:\RGHTEST\U23 > C:\RGHTTMP\UNOV\U23_RWCE.OUT
\PUBLIC\RIGHTS F:\RGHTEST\U23 > C:\RGHTTMP\UPUB\U23_RWCE.OUT
ECHO Starting U24_RAL as NOPASSUSER... >> C:\RGHTTMP\HELPER.TXT
\NPUBLIC\RIGHTS F:\RGHTEST\U24 > C:\RGHTTMP\UNOV\U24_RAL.OUT
\PUBLIC\RIGHTS F:\RGHTEST\U24 > C:\RGHTTMP\UPUB\U24_RAL.OUT
ECHO Starting U25_SAL as NOPASSUSER... >> C:\RGHTTMP\HELPER.TXT
\NPUBLIC\RIGHTS F:\RGHTEST\U25 > C:\RGHTTMP\UNOV\U25_SAL.OUT
\PUBLIC\RIGHTS F:\RGHTEST\U25 > C:\RGHTTMP\UPUB\U25_SAL.OUT
ECHO Starting U26_ALL as NOPASSUSER... >> C:\RGHTTMP\HELPER.TXT
\NPUBLIC\RIGHTS F:\RGHTEST\U26 > C:\RGHTTMP\UNOV\U26_ALL.OUT
\PUBLIC\RIGHTS F:\RGHTEST\U26 > C:\RGHTTMP\UPUB\U26_ALL.OUT
ECHO Starting U27_N as NOPASSUSER... >> C:\RGHTTMP\HELPER.TXT
\NPUBLIC\RIGHTS F:\RGHTEST\U27 > C:\RGHTTMP\UNOV\U27_N.OUT
\PUBLIC\RIGHTS F:\RGHTEST\U27 > C:\RGHTTMP\UPUB\U27_N.OUT
ECHO Starting U30_RE as NOPASSUSER... >> C:\RGHTTMP\HELPER.TXT
\NPUBLIC\RIGHTS F:\RGHTEST\U30 > C:\RGHTTMP\UNOV\U30_RE.OUT
\PUBLIC\RIGHTS F:\RGHTEST\U30 > C:\RGHTTMP\UPUB\U30_RE.OUT
ECHO Starting U31_RWF as NOPASSUSER... >> C:\RGHTTMP\HELPER.TXT
\NPUBLIC\RIGHTS F:\RGHTEST\U31 > C:\RGHTTMP\UNOV\U31_RWF.OUT
\PUBLIC\RIGHTS F:\RGHTEST\U31 > C:\RGHTTMP\UPUB\U31_RWF.OUT
ECHO Starting U32_RCM as NOPASSUSER... >> C:\RGHTTMP\HELPER.TXT
\NPUBLIC\RIGHTS F:\RGHTEST\U32 > C:\RGHTTMP\UNOV\U32_RCM.OUT
\PUBLIC\RIGHTS F:\RGHTEST\U32 > C:\RGHTTMP\UPUB\U32_RCM.OUT
ECHO Starting U33_RFA as NOPASSUSER... >> C:\RGHTTMP\HELPER.TXT
\NPUBLIC\RIGHTS F:\RGHTEST\U33 > C:\RGHTTMP\UNOV\U33_RFA.OUT
\PUBLIC\RIGHTS F:\RGHTEST\U33 > C:\RGHTTMP\UPUB\U33_RFA.OUT
ECHO Starting U34_WCM as NOPASSUSER... >> C:\RGHTTMP\HELPER.TXT
\NPUBLIC\RIGHTS F:\RGHTEST\U34 > C:\RGHTTMP\UNOV\U34_WCM.OUT
\PUBLIC\RIGHTS F:\RGHTEST\U34 > C:\RGHTTMP\UPUB\U34_WCM.OUT
ECHO Starting U35_EMF as NOPASSUSER... >> C:\RGHTTMP\HELPER.TXT
\NPUBLIC\RIGHTS F:\RGHTEST\U35 > C:\RGHTTMP\UNOV\U35_EMF.OUT
\PUBLIC\RIGHTS F:\RGHTEST\U35 > C:\RGHTTMP\UPUB\U35_EMF.OUT
ECHO Starting U36_RMF as NOPASSUSER... >> C:\RGHTTMP\HELPER.TXT
\NPUBLIC\RIGHTS F:\RGHTEST\U36 > C:\RGHTTMP\UNOV\U36_RMF.OUT
\PUBLIC\RIGHTS F:\RGHTEST\U36 > C:\RGHTTMP\UPUB\U36_RMF.OUT
ECHO Starting U37_REMA as NOPASSUSER... >> C:\RGHTTMP\HELPER.TXT
\NPUBLIC\RIGHTS F:\RGHTEST\U37 > C:\RGHTTMP\UNOV\U37_REMA.OUT
\PUBLIC\RIGHTS F:\RGHTEST\U37 > C:\RGHTTMP\UPUB\U37_REMA.OUT
ECHO Starting U38_SR as NOPASSUSER... >> C:\RGHTTMP\HELPER.TXT
\NPUBLIC\RIGHTS F:\RGHTEST\U38 > C:\RGHTTMP\UNOV\U38_SR.OUT
\PUBLIC\RIGHTS F:\RGHTEST\U38 > C:\RGHTTMP\UPUB\U38_SR.OUT
ECHO Starting U39_SRF as NOPASSUSER... >> C:\RGHTTMP\HELPER.TXT
\NPUBLIC\RIGHTS F:\RGHTEST\U39 > C:\RGHTTMP\UNOV\U39_SRF.OUT
\PUBLIC\RIGHTS F:\RGHTEST\U39 > C:\RGHTTMP\UPUB\U39_SRF.OUT
ECHO Starting U40_SWCM as NOPASSUSER... >> C:\RGHTTMP\HELPER.TXT
\NPUBLIC\RIGHTS F:\RGHTEST\U40 > C:\RGHTTMP\UNOV\U40_SWCM.OUT
\PUBLIC\RIGHTS F:\RGHTEST\U40 > C:\RGHTTMP\UPUB\U40_SWCM.OUT
ECHO Starting F10_R as NOPASSUSER... >> C:\RGHTTMP\HELPER.TXT
\NPUBLIC\RIGHTS F:\RGHTEST\UF10\F.TXT > C:\RGHTTMP\UNOV\F10_R.OUT
\PUBLIC\RIGHTS F:\RGHTEST\UF10\F.TXT > C:\RGHTTMP\UPUB\F10_R.OUT
ECHO Starting F11_RF as NOPASSUSER... >> C:\RGHTTMP\HELPER.TXT
\NPUBLIC\RIGHTS F:\RGHTEST\UF11\F.TXT > C:\RGHTTMP\UNOV\F11_RF.OUT
\PUBLIC\RIGHTS F:\RGHTEST\UF11\F.TXT > C:\RGHTTMP\UPUB\F11_RF.OUT
ECHO Starting F12_RAL as NOPASSUSER... >> C:\RGHTTMP\HELPER.TXT
\NPUBLIC\RIGHTS F:\RGHTEST\UF12\F.TXT > C:\RGHTTMP\UNOV\F12_RAL.OUT
\PUBLIC\RIGHTS F:\RGHTEST\UF12\F.TXT > C:\RGHTTMP\UPUB\F12_RAL.OUT
ECHO Starting F13_ALL as NOPASSUSER... >> C:\RGHTTMP\HELPER.TXT
\NPUBLIC\RIGHTS F:\RGHTEST\UF13\F.TXT > C:\RGHTTMP\UNOV\F13_ALL.OUT
\PUBLIC\RIGHTS F:\RGHTEST\UF13\F.TXT > C:\RGHTTMP\UPUB\F13_ALL.OUT
ECHO Starting F14_N as NOPASSUSER... >> C:\RGHTTMP\HELPER.TXT
\NPUBLIC\RIGHTS F:\RGHTEST\UF14\F.TXT > C:\RGHTTMP\UNOV\F14_N.OUT
\PUBLIC\RIGHTS F:\RGHTEST\UF14\F.TXT > C:\RGHTTMP\UPUB\F14_N.OUT
ECHO Starting F15_S as NOPASSUSER... >> C:\RGHTTMP\HELPER.TXT
\NPUBLIC\RIGHTS F:\RGHTEST\UF15\F.TXT > C:\RGHTTMP\UNOV\F15_S.OUT
\PUBLIC\RIGHTS F:\RGHTEST\UF15\F.TXT > C:\RGHTTMP\UPUB\F15_S.OUT
ECHO Starting F16_SAL as NOPASSUSER... >> C:\RGHTTMP\HELPER.TXT
\NPUBLIC\RIGHTS F:\RGHTEST\UF16\F.TXT > C:\RGHTTMP\UNOV\F16_SAL.OUT
\PUBLIC\RIGHTS F:\RGHTEST\UF16\F.TXT > C:\RGHTTMP\UPUB\F16_SAL.OUT

:RELSUP
ECHO Logging out NOPASSUSER and returning to SUPERVISOR. >> C:\RGHTTMP\HELPER.TXT
LOGOUT > C:\RGHTTMP\ULOG2.OUT

F:
CD \
IF EXIST \LOGIN\LOGIN.EXE GOTO HAVELOGIN
ECHO F:\LOGIN\LOGIN.EXE not found. >> C:\RGHTTMP\HELPER.TXT
GOTO MANUAL

:HAVELOGIN
F:\LOGIN\LOGIN SUPERVISOR /PWD:%LGNTPWD% > C:\RGHTTMP\ULOGSUP.OUT

F:
CD \
IF EXIST \RGHTSTA.BAT GOTO QUEUEP2
ECHO F: not restored or \RGHTSTA.BAT not visible. >> C:\RGHTTMP\HELPER.TXT
GOTO MANUAL

:QUEUEP2
C:
CD \RGHTTMP
IF EXIST DLYSTRT.EXE GOTO HVDLY
ECHO C:\RGHTTMP\DLYSTRT.EXE not found. >> HELPER.TXT
GOTO MANUAL

:HVDLY
ECHO Queueing F:\RGHTSTA.BAT PART2 via DLYSTRT. >> HELPER.TXT
DLYSTRT /T:2 F:\RGHTSTA.BAT PART2
GOTO END

:MANUAL
ECHO Manual steps required:
ECHO   LOGIN SUPERVISOR
ECHO   F:
ECHO   CD \
ECHO   RGHTSTA PART2
ECHO   RGHTZIP
ECHO Manual steps required. >> C:\RGHTTMP\HELPER.TXT

:END
ECHO RGHTC finished. >> C:\RGHTTMP\HELPER.TXT
