Comment ======================================================== Copyright 1990 by Marc Perkel * All right reserved. Requires MarxMenu version 2.14 or later to run. MarxMenu now allows you to login to a Novell network without using Novell's login program or messing with nasty login scripts. You can be in MarxMenu all the way in. Loging into Novell is tricky. Especially if you are using boot roms on your network cards. Through much trial and error, I have found some solid tricks that make life easier. You should have the following two BATCH files in your LOGIN directory as follows: LOADNET.BAT ----------- NET4 F: STARTUP STARTUP.BAT ----------- SET BOOTUP=LOGIN MarxMenu Login %BOOTUP% Each workstation should have their own AUTOEXEC.BAT. The last line should be LOADNET. If you are running multiple versions of dos you can have the first line of LOADNET.BAT be %NET%. You will then have to have SET NET=NET4 in your AUTOEXEC.BAT file. Also, if you want automatic login you can add the following lines: SET USERNAME=MARC Your Name Here SET PASSWORD=NERD Your Password Here You should also change the COMSPEC= to the network command.com BEFORE you run NET4. For some unknown reason, this solves a lot of problems. Another boot rom quirk is that you can't run any program off a boot rom that trashes upper memory. An example is running QEMM on a monochrome monitor. By using this method the boot disk or boot rom hands control over in a clean way. LOADNET.BAT then branches to STARTUP.BAT for the rest of the login sequence. For some strange reason which I can't explain, LOADNET and STARTUP have to be two separate batch files. I think it forces the transient part of COMMAND.COM to load into memory. Anyhow, don't combine these into one batch file The first line of STARTUP.BAT is a message that tells this menu that the user is logging in for the first time. This menu creates a batch file and puts the name of it in the environment variable BOOTUP. STARTUP.BAT then executes this file. This is the example for MY network. You'll have to modify it for yours. One word of caution. After modifing this menu, always run MARXCOMP LOGIN to compile it. Otherwise, if you boot up into it you won't have enough access rights to recompile automatically. ======================================================== EndComment var UserName PassW Logged Station NetAddress SmartDir MyServer Servers Video HomeDir DosDir BatFile BatName FancyScreen MasterEnvironment Comment ======================================================== If Environment variables USERNAME and PASSWORD are set, this menu will attempt to log into the network using these values. This allows for automatic login. You can also pass the parameters on the command line as follows. MarxMenu Login The name may contain a referrence to a server: Server/Name ======================================================== EndComment ;------ If CapsLock then override default login Logged = False if not CapsLock UserName = ParamStr(2) if UserName = '' then UserName = ReadEnv('USERNAME') if UserName > '' PassW = ParamStr(3) if PassW = '' then PassW = ReadEnv('PASSWORD') if PassW > '' NovLogin (UserName,PassW) Logged = NovResult = 0 endif endif endif MyServer = NovDefaultServer NovServers(Servers) ;------ Fills station to 3 digits. Example: 004 Station = Str(NovConnection) while length(Station) < 3 Station = '0' + Station endwhile ;------ Read network address NetAddress = NovStationAddress (NovConnection) ;------ Select colors and prepare screen if not Logged FancyScreen = True if ColorScreen TextColor White Red BoxBorderColor Green Brown BoxInsideColor Black Brown ClearScreen 176 ClockColor Black Brown TextColor Black Green BoxHeaderColor Yellow Mag Shadow else TextColor Grey Black ClearScreen 176 TextColor Black Grey BoxBorderColor Black Grey BoxInsideColor Black Grey BoxHeaderColor Black Grey ClockColor Black Grey endif BlankMessage = 'Netware Login' ClockMode = 262 GotoXY 1 25 ClearLine WriteCenter "Computer Tyme Master Network Login Menu" SingleLineBox Explode Off ShadowColor Grey Red if ColorScreen DrawBox 3 2 74 5 ClockPos 42 5 TextColor Blue Brown else DrawBox 3 2 76 5 ClockPos 44 5 endif WriteCenter 'Computer Tyme Software Development Laboratory' Writeln TextColor Black Brown WriteCenter '컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴�' Writeln TextColor Black Brown Write " (C) 1990 by Marc Perkel" DoubleLineBox BlankTime = 10 Explode On BlockBox BoxBorderColor Green Blue BoxInsideColor Yellow Blue BoxHeader = " Station Information " if ColorScreen DrawBox 39 17 38 6 TextColor Yellow Blue else DrawBox 41 17 38 6 TextColor Grey Black endif Writeln ' Server: ' MyServer Writeln ' Network: ' NetAddress Writeln ' Connection: ' Station Write ' DOS Version: ' DosVersionString BoxHeader = ' Logging into Server * ' + MyServer + ' ' DrawBox 3 10 50 4 endif Security while not Logged if UserName = '' ClearScreen Write ' Login Name: ' UserName = UpperCase(Readln) Writeln if UserName = 'EXIT' then ExitMenu endif if not Logged Write ' Password: ' PassW = Readln NovLogin (UserName,PassW) Logged = NovResult = 0 endif if not Logged then UserName = '' endwhile if FancyScreen EraseTopWindow EraseTopWindow EraseTopWindow EraseTopWindow TextColor Grey Black ClearScreen endif UserName = NovMyLoginName Comment ======================================================== Here we set a different directory for a program depending on if we have a comol or monochrome monitor. ======================================================== EndComment if VideoMode = Mono SmartDir = 'F:\PUBLIC\MSMART' else SmartDir = 'F:\PUBLIC\CSMART' endif Comment ======================================================== You can't assume that you have an F: drive unless you map it. ======================================================== EndComment NovMapDrive ('F','SYS:\LOGIN') HomeDir = 'F:\HOME\' + UserName if UserName = 'SUPERVISOR' then HomeDir = 'F:\SYSTEM' if not ExistDir(HomeDir) then HomeDir = 'F:\PUBLIC\APPS' DosDir = 'F:\PUBLIC\DOSV' + DosVersionString Comment ======================================================== Here's where we map our drives. This does not set the search path. You set that explicitly by writing to the PATH environment variable. Drive map commands may contain server and volume referrences: MovMapDrive('I','TYME/VOL1:SERVICE') ======================================================== EndComment NovMapDrive ('Z',HomeDir) NovMapDrive ('Y','F:\PUBLIC\APPS') NovMapDrive ('X',DosDir) NovMapDrive ('W','F:\PUBLIC\UTIL') NovMapDrive ('P','F:\PUBLIC') NovMapDrive ('U','F:\SYSTEM') NovMapDrive ('L','F:\LOGIN') if MyServer = 'TYME' then NovMapDrive ('I','VOL1:') if MyServer = 'MARX2' NovMapDrive ('M','F:\PUBLIC\MARX') else NovMapDrive ('S',SmartDir) endif SetEnv ('PASSWORD=') SetEnv ('NET=') SetEnv ('USERNAME=' + UserName) SetEnv ('STATION=' + Station) SetEnv ('COMSPEC=X:COMMAND.COM') SetEnv ('PROMPT=$e[1;33m$p: $e[0;32m') SetEnv ('PD.EXE=/$Z:PD.PIC') SetEnv ('MXCTL=/C') SetEnv ('MXECHO=OFF') if MyServer = 'MARX2' SetEnv ('PATH=Z:.;Y:.;X:.;W:.;P:.;U:.;M:.;') else SetEnv ('PATH=Z:.;Y:.;X:.;W:.;P:.;U:.;S:.;') endif ChDir HomeDir ;------ Opens a semaphore that XMETER can read. NovOpenSemaphore ('XM-LOGIN',0) ;------ LOGIN is set to BOOTUP if logging in for the first time if UpperCase(ReadEnv('BOOTUP')) <> 'LOGIN' then ExitMenu ;------ Create temporary batch file for rest of login sequence BatName = 'Z:$MRX' + Station + '.BAT' SetEnv ('BOOTUP=' + BATNAME) FileAssign(BatFile,BatName) FileCreate(BatFile) ;----- Load TSRs if DosVersionString < '3.30' WriteBat('ECHO OFF') else WriteBat('@ECHO OFF') endif WriteBat ('SET BOOTUP=') WriteBat ('MARK > NUL') ;----- Load Lan Assist WriteBat ('\PUBLIC\LA\LA +N >NUL') Comment ================================================================ This next section deals with running special programs bases on the physical station number rather than by user. This deals with special hardware that needs software drivers loaded. ================================================================ EndComment if NetAddress = '255:9' WriteBat('mode mono') endif if UserName = 'MARC' SideKick Capture endif if UserName = 'VICKI' SideKick endif if UserName = 'KEVIN' ;Capture SetEnv( 'PATH=c:\dos33;c:\bin;c:\marx;c:\dv;' + ReadEnv( 'Path' ) ) endif if UserName = '386' Capture endif if UserName = 'GRACE' SideKick endif if UserName = 'NITA' SideKick endif if UserName = 'WORK' Capture endif ;----- CD ROM Machine ;if NetAddress = '255:2' ; WriteBat ('CD\PUBLIC\MA') ; WriteBat ('MSCDEX.EXE /D:MSCD003 /M:12') ; WriteBat ('MAR C:\ RW=/ /C') ;endif ;----- Vicki's Printer ;if NetAddress = '255:65' ; WriteBat ('RPRINTER TYME 3') ;endif ;----- Grace's Printer ;if NetAddress = '255:68' ; WriteBat ('RPRINTER TYME 2') ; WriteBat ('LA /L' ) ;endif ;----- Pos Printer ;if NetAddress = '255:6' ; WriteBat ('RPRINTER TYME 4') ;endif ;----- Marc's Home Computer if NetAddress = '254:41' SetEnv ('PATH=C:\TURBO5;C:\;' + ReadEnv('PATH')) endif WriteBat ('CLS' ) ;----- If Y: has a BAT file matching the UserName the run it. if ExistFile ('Y:' + UserName + '.BAT') WriteBat ('DROPTO ' + BatName + ' Y:' + UserName) endif ;----- If AUTO.BAT exists in the users home directory then run it. if ExistFile('AUTO.BAT') WriteBat ('DROPTO ' + BatName + ' AUTO') endif FileClose(BatFile) ExitMenu ;----- Procedure Definitions Procedure WriteBat (BatLine) FileWriteln(BatFile,BatLine) EndProc Procedure Pause WriteBat ('PAUSE') EndProc Procedure SideKick WriteBat ('Return > NUL') WriteBat ('SwapSk/N/G/D' + HomeDir + ' >NUL') WriteBat ('Sk') EndProc Procedure Capture WriteBat ('capture q=printq_0 c=1 nb nff ti=5 l=1>NUL') WriteBat ('capture q=printq_1 c=1 nb nff ti=5 l=2>NUL') EndProc