@ECHO OFF
REM SLSTC.BAT
REM Local helper for SLSTSTA.BAT logged-out SLIST comparison.
REM Runs from C:\SLSTTMP.  It logs out, runs SLIST without any logged-in
REM user, logs SUPERVISOR back in, then queues F:\SLSTSTA.BAT PART2.

C:
CD \SLSTTMP

ECHO SLSTC helper started. > C:\SLSTTMP\HELPER.TXT
ECHO This helper logs out and runs SLIST while no user is logged in. >> C:\SLSTTMP\HELPER.TXT
ECHO. >> C:\SLSTTMP\HELPER.TXT

IF NOT EXIST LOUT\NUL MD LOUT
IF NOT EXIST LPUBOUT\NUL MD LPUBOUT

ECHO === L00 LOGOUT from initial session === >> C:\SLSTTMP\HELPER.TXT
C:\SLSTTMP\LOGOUT.EXE > C:\SLSTTMP\L00_LOG.OUT

ECHO === LOGGED-OUT NOVELL BASELINE: NLOGIN\SLIST === >> C:\SLSTTMP\HELPER.TXT
C:\SLSTTMP\NSLIST.EXE > C:\SLSTTMP\LOUT\D01_LIST.OUT
C:\SLSTTMP\NSLIST.EXE MARS > C:\SLSTTMP\LOUT\D02_MARS_OK.OUT
C:\SLSTTMP\NSLIST.EXE NWBYGONE01 > C:\SLSTTMP\LOUT\D03_NWBYGONE01_MISSING.OUT
C:\SLSTTMP\NSLIST.EXE /CONTINUE > C:\SLSTTMP\LOUT\D04_CONT.OUT
C:\SLSTTMP\NSLIST.EXE MARS /CONTINUE > C:\SLSTTMP\LOUT\D05_MARS_CONT_OK.OUT
C:\SLSTTMP\NSLIST.EXE NWBYGONE01 /CONTINUE > C:\SLSTTMP\LOUT\D06_NWBYGONE01_CONT_MISSING.OUT
ECHO Usage: SLIST [Server] [/Continue] > C:\SLSTTMP\LOUT\D99_HELP.OUT

ECHO === LOGGED-OUT PUBLIC IMPLEMENTATION: LOGIN\SLIST === >> C:\SLSTTMP\HELPER.TXT
C:\SLSTTMP\SLIST.EXE > C:\SLSTTMP\LPUBOUT\D01_LIST.OUT
C:\SLSTTMP\SLIST.EXE MARS > C:\SLSTTMP\LPUBOUT\D02_MARS_OK.OUT
C:\SLSTTMP\SLIST.EXE NWBYGONE01 > C:\SLSTTMP\LPUBOUT\D03_NWBYGONE01_MISSING.OUT
C:\SLSTTMP\SLIST.EXE /CONTINUE > C:\SLSTTMP\LPUBOUT\D04_CONT.OUT
C:\SLSTTMP\SLIST.EXE MARS /CONTINUE > C:\SLSTTMP\LPUBOUT\D05_MARS_CONT_OK.OUT
C:\SLSTTMP\SLIST.EXE NWBYGONE01 /CONTINUE > C:\SLSTTMP\LPUBOUT\D06_NWBYGONE01_CONT_MISSING.OUT
C:\SLSTTMP\SLIST.EXE /? > C:\SLSTTMP\LPUBOUT\D99_HELP.OUT

IF "%LGNTPWD%"=="" GOTO MANUAL

ECHO === L99 LOGIN SUPERVISOR using local LOGIN === >> C:\SLSTTMP\HELPER.TXT
C:\SLSTTMP\LOGIN.EXE SUPERVISOR /PWD:%LGNTPWD% > C:\SLSTTMP\L99_LGSUP.OUT

F:
CD \
IF EXIST F:\SLSTSTA.BAT GOTO QUEUEP2
ECHO F: not restored or F:\SLSTSTA.BAT missing after supervisor login. >> C:\SLSTTMP\HELPER.TXT
ECHO.
ECHO F: wurde nicht wiederhergestellt oder F:\SLSTSTA.BAT fehlt.
ECHO Bitte manuell pruefen und dann ausfuehren:
ECHO   F:
ECHO   CD \
ECHO   SLSTSTA PART2
GOTO END

:QUEUEP2
ECHO F: is available. Queueing delayed SLSTSTA PART2. >> C:\SLSTTMP\HELPER.TXT
C:
CD \SLSTTMP
C:\SLSTTMP\DLYSTRT.EXE /T:2 F:\SLSTSTA.BAT PART2 > C:\SLSTTMP\L98_P2.OUT
ECHO SLSTC queued F:\SLSTSTA.BAT PART2. >> C:\SLSTTMP\HELPER.TXT
ECHO.
ECHO SLSTC fertig. PART2 wird per DLYSTRT gestartet.
GOTO END

:MANUAL
ECHO LGNTPWD is not set; automatic SUPERVISOR login skipped. >> C:\SLSTTMP\HELPER.TXT
ECHO.
ECHO SLSTC fertig. Jetzt manuell wieder als SUPERVISOR einloggen.
ECHO Danach ausfuehren:
ECHO   F:\SLSTSTA PART2
ECHO.

:END
