@ECHO OFF
REM CIXC.BAT - delayed user-context CREATOR readback helper.
REM Started by CIXSTA via DLYSTRT. Runs from C:\CIXTMP.

C:
CD \CIXTMP

ECHO CIXC user-context CREATOR readback helper > HELPER.TXT
ECHO Current phase: logout supervisor, login NOPASSUSER. >> HELPER.TXT

IF NOT EXIST UNOV MD UNOV
IF NOT EXIST UPUB MD UPUB
IF NOT EXIST UCREATOR MD UCREATOR

LOGOUT > ULOG1.OUT
LOGIN NOPASSUSER > ULOGIN.OUT

F:
CD \
IF EXIST \PUBLIC\CREATOR.EXE GOTO HAVEF
ECHO F: not ready after NOPASSUSER login. >> C:\CIXTMP\HELPER.TXT
GOTO RELSUP

:HAVEF
ECHO Capturing NOPASSUSER RIGHTS readback... >> C:\CIXTMP\HELPER.TXT
\NPUBLIC\RIGHTS F:\CIXTEST\SUP > C:\CIXTMP\UNOV\SUPRGT.OUT
\PUBLIC\RIGHTS F:\CIXTEST\SUP > C:\CIXTMP\UPUB\SUPRGT.OUT
\NPUBLIC\RIGHTS F:\CIXTEST\SUP\S_SUP.TXT > C:\CIXTMP\UNOV\RSUP.OUT
\PUBLIC\RIGHTS F:\CIXTEST\SUP\S_SUP.TXT > C:\CIXTMP\UPUB\RSUP.OUT
\NPUBLIC\RIGHTS F:\CIXTEST\SUP\S_ARCH.TXT > C:\CIXTMP\UNOV\RARCH.OUT
\PUBLIC\RIGHTS F:\CIXTEST\SUP\S_ARCH.TXT > C:\CIXTMP\UPUB\RARCH.OUT
\NPUBLIC\RIGHTS F:\CIXTEST\SUP\S_ALL.TXT > C:\CIXTMP\UNOV\RALL.OUT
\PUBLIC\RIGHTS F:\CIXTEST\SUP\S_ALL.TXT > C:\CIXTMP\UPUB\RALL.OUT

ECHO Capturing PUBLIC\CREATOR /SHOW as NOPASSUSER... >> C:\CIXTMP\HELPER.TXT
\PUBLIC\CREATOR F:\CIXTEST\SUP\S_SUP.TXT /SHOW > C:\CIXTMP\UCREATOR\CSUP.OUT
\PUBLIC\CREATOR F:\CIXTEST\SUP\S_ARCH.TXT /SHOW > C:\CIXTMP\UCREATOR\CARCH.OUT
\PUBLIC\CREATOR F:\CIXTEST\SUP\S_ALL.TXT /SHOW > C:\CIXTMP\UCREATOR\CALL.OUT

:RELSUP
ECHO Relogin as SUPERVISOR. >> C:\CIXTMP\HELPER.TXT
C:
CD \CIXTMP
LOGOUT > ULOG2.OUT

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

:HAVELOG
F:\LOGIN\LOGIN SUPERVISOR /PWD:%LGNTPWD% > C:\CIXTMP\ULGSUP.OUT

F:
CD \
IF EXIST F:\CIXSTA.BAT GOTO QUEUEP2
ECHO F:\CIXSTA.BAT missing after SUPERVISOR login. >> C:\CIXTMP\HELPER.TXT
GOTO MANUAL

:QUEUEP2
C:\CIXTMP\DLYSTRT /T:2 F:\CIXSTA.BAT PART2
GOTO END

:MANUAL
ECHO Please run manually after SUPERVISOR login: >> C:\CIXTMP\HELPER.TXT
ECHO   F: >> C:\CIXTMP\HELPER.TXT
ECHO   CD \ >> C:\CIXTMP\HELPER.TXT
ECHO   CIXSTA PART2 >> C:\CIXTMP\HELPER.TXT

:END
