@ECHO OFF
REM FLGC.BAT - helper for FLGTSTA user-context FLAG tests.
C:
CD \FLGTMP
ECHO FLGC helper started. > C:\FLGTMP\HELPER.TXT
ECHO Running FLAG as NOPASSUSER, then relogging SUPERVISOR. >> C:\FLGTMP\HELPER.TXT

LOGOUT > C:\FLGTMP\D00_LOG.OUT
LOGIN NOPASSUSER > C:\FLGTMP\D01_LGIN.OUT
F:
CD \

ECHO Starting U10 read...
NPUBLIC\FLAG F:\FLGTEST\ALPHA.TXT N > NUL
NPUBLIC\FLAG F:\FLGTEST\ALPHA.TXT > C:\FLGTMP\UNOV\U10_READ.OUT
PUBLIC\FLAG F:\FLGTEST\ALPHA.TXT > C:\FLGTMP\UPUB\U10_READ.OUT

ECHO Starting U11 N...
NPUBLIC\FLAG F:\FLGTEST\ALPHA.TXT +H > NUL
NPUBLIC\FLAG F:\FLGTEST\ALPHA.TXT N > C:\FLGTMP\UNOV\U11_N.OUT
NPUBLIC\FLAG F:\FLGTEST\ALPHA.TXT +H > NUL
PUBLIC\FLAG F:\FLGTEST\ALPHA.TXT N > C:\FLGTMP\UPUB\U11_N.OUT

ECHO Starting U12 H...
NPUBLIC\FLAG F:\FLGTEST\ALPHA.TXT N > NUL
NPUBLIC\FLAG F:\FLGTEST\ALPHA.TXT +H > C:\FLGTMP\UNOV\U12_H.OUT
NPUBLIC\FLAG F:\FLGTEST\ALPHA.TXT >> C:\FLGTMP\UNOV\U12_H.OUT
NPUBLIC\FLAG F:\FLGTEST\ALPHA.TXT N > NUL
PUBLIC\FLAG F:\FLGTEST\ALPHA.TXT +H > C:\FLGTMP\UPUB\U12_H.OUT
PUBLIC\FLAG F:\FLGTEST\ALPHA.TXT >> C:\FLGTMP\UPUB\U12_H.OUT

ECHO Starting U13 RO...
NPUBLIC\FLAG F:\FLGTEST\BETA.TXT N > NUL
NPUBLIC\FLAG F:\FLGTEST\BETA.TXT +RO > C:\FLGTMP\UNOV\U13_RO.OUT
NPUBLIC\FLAG F:\FLGTEST\BETA.TXT >> C:\FLGTMP\UNOV\U13_RO.OUT
NPUBLIC\FLAG F:\FLGTEST\BETA.TXT N > NUL
PUBLIC\FLAG F:\FLGTEST\BETA.TXT +RO > C:\FLGTMP\UPUB\U13_RO.OUT
PUBLIC\FLAG F:\FLGTEST\BETA.TXT >> C:\FLGTMP\UPUB\U13_RO.OUT

ECHO Starting U14 A...
NPUBLIC\FLAG F:\FLGTEST\GAMMA.DAT N > NUL
NPUBLIC\FLAG F:\FLGTEST\GAMMA.DAT +A > C:\FLGTMP\UNOV\U14_A.OUT
NPUBLIC\FLAG F:\FLGTEST\GAMMA.DAT >> C:\FLGTMP\UNOV\U14_A.OUT
NPUBLIC\FLAG F:\FLGTEST\GAMMA.DAT N > NUL
PUBLIC\FLAG F:\FLGTEST\GAMMA.DAT +A > C:\FLGTMP\UPUB\U14_A.OUT
PUBLIC\FLAG F:\FLGTEST\GAMMA.DAT >> C:\FLGTMP\UPUB\U14_A.OUT

ECHO Starting U15 SY...
NPUBLIC\FLAG F:\FLGTEST\DELTA.BIN N > NUL
NPUBLIC\FLAG F:\FLGTEST\DELTA.BIN +SY > C:\FLGTMP\UNOV\U15_SY.OUT
NPUBLIC\FLAG F:\FLGTEST\DELTA.BIN >> C:\FLGTMP\UNOV\U15_SY.OUT
NPUBLIC\FLAG F:\FLGTEST\DELTA.BIN N > NUL
PUBLIC\FLAG F:\FLGTEST\DELTA.BIN +SY > C:\FLGTMP\UPUB\U15_SY.OUT
PUBLIC\FLAG F:\FLGTEST\DELTA.BIN >> C:\FLGTMP\UPUB\U15_SY.OUT

ECHO Starting U16 DI RI...
NPUBLIC\FLAG F:\FLGTEST\EPS.TXT N > NUL
NPUBLIC\FLAG F:\FLGTEST\EPS.TXT +DI +RI > C:\FLGTMP\UNOV\U16_DIRI.OUT
NPUBLIC\FLAG F:\FLGTEST\EPS.TXT >> C:\FLGTMP\UNOV\U16_DIRI.OUT
NPUBLIC\FLAG F:\FLGTEST\EPS.TXT N > NUL
PUBLIC\FLAG F:\FLGTEST\EPS.TXT +DI +RI > C:\FLGTMP\UPUB\U16_DIRI.OUT
PUBLIC\FLAG F:\FLGTEST\EPS.TXT >> C:\FLGTMP\UPUB\U16_DIRI.OUT

ECHO Starting U17 mixed...
NPUBLIC\FLAG F:\FLGTEST\ALPHA.TXT N > NUL
NPUBLIC\FLAG F:\FLGTEST\ALPHA.TXT +H +RO +A > C:\FLGTMP\UNOV\U17_MIX.OUT
NPUBLIC\FLAG F:\FLGTEST\ALPHA.TXT >> C:\FLGTMP\UNOV\U17_MIX.OUT
NPUBLIC\FLAG F:\FLGTEST\ALPHA.TXT N > NUL
PUBLIC\FLAG F:\FLGTEST\ALPHA.TXT +H +RO +A > C:\FLGTMP\UPUB\U17_MIX.OUT
PUBLIC\FLAG F:\FLGTEST\ALPHA.TXT >> C:\FLGTMP\UPUB\U17_MIX.OUT

ECHO Starting U18 clear...
NPUBLIC\FLAG F:\FLGTEST\ALPHA.TXT +H +RO +A > NUL
NPUBLIC\FLAG F:\FLGTEST\ALPHA.TXT -H -RO -A > C:\FLGTMP\UNOV\U18_CLR.OUT
NPUBLIC\FLAG F:\FLGTEST\ALPHA.TXT >> C:\FLGTMP\UNOV\U18_CLR.OUT
NPUBLIC\FLAG F:\FLGTEST\ALPHA.TXT +H +RO +A > NUL
PUBLIC\FLAG F:\FLGTEST\ALPHA.TXT -H -RO -A > C:\FLGTMP\UPUB\U18_CLR.OUT
PUBLIC\FLAG F:\FLGTEST\ALPHA.TXT >> C:\FLGTMP\UPUB\U18_CLR.OUT

ECHO Starting U90 missing...
NPUBLIC\FLAG F:\FLGTEST\NOFILE.TXT > C:\FLGTMP\UNOV\U90_MISS.OUT
PUBLIC\FLAG F:\FLGTEST\NOFILE.TXT > C:\FLGTMP\UPUB\U90_MISS.OUT

LOGOUT > C:\FLGTMP\D02_LGOT.OUT
F:
CD \
IF EXIST \LOGIN\LOGIN.EXE GOTO HAVELOGIN
ECHO F:\LOGIN\LOGIN.EXE not found. >> C:\FLGTMP\HELPER.TXT
GOTO END
:HAVELOGIN
F:\LOGIN\LOGIN SUPERVISOR /PWD:%LGNTPWD% > C:\FLGTMP\D03_LGSU.OUT
F:
CD \
IF EXIST \FLGTSTA.BAT GOTO QUEUEP2
ECHO F: not restored or FLGTSTA missing. >> C:\FLGTMP\HELPER.TXT
GOTO END
:QUEUEP2
C:
CD \FLGTMP
DLYSTRT /T:2 F:\FLGTSTA.BAT PART2 > C:\FLGTMP\D04_P2.OUT
:END
