BootSys User Logging System 1.32 ================================ J.G.Harston, 1998-1999 70 Camm Street, Walkley, Sheffield S6 3TR jgh@arcade.demon.co.uk This program has been released into Public Domain. However we still retain all Copyright. Introduction ============ BootSys is a user logging system that assigns drive letters to directory paths specific to that user. These users can be grouped arbitarily and given separate drive letters to reference separate logical areas. It can be used as a front-end to a single computer system to give it the appearance of being connected to a multi-user server. It can also be used to set up drive paths for a pre-validated user on an shared server system. Additionally, it can be configured to execute specific commands the first time the computer is run each day. This can be usefully used to run a virus scanner or to bulk fetch external email. Installing ========== Copy the files into a directory, such as C:\APPS\BOOT. Call this the Boot directory. Make this directory hidden, either using the file manager, or using ATTRIB -H C:\APPS\BOOT from the DOS prompt. 1: In the Boot directory is a directory called COMMAND. Edit the batch files in here and change the line that defines the BOOT variable with SET BOOT= to point the Boot directory. In the above example, this line would read: SET BOOT=C:\APPS\BOOT 2: If your Windows system is not in directory C:\WINDOWS, then edit WIN.BAT so the parameter passed to LOGON contains the name of the Windows command file. By default, this line says something like: %BOOT%\LOGON %BOOT%\ -START C:\WINDOWS\WIN If the windows path is D:\WIN311\WIN, then this line should say: %BOOT%\LOGON %BOOT%\ -START D:\WIN311\WIN 3: Edit the system's AUTOEXEC.BAT and change the line that starts PATH and add the name of the COMMAND directory before the windows directory. If this line starts as: PATH C:\WINDOWS;C:\DOS then it will now say: PATH C:\APPS\BOOT\COMMAND;C:\WINDOWS;C:\DOS Removing the Boot system ======================== Edit the AUTOEXEC.BAT file and remove the reference to the Boot Command directory from the PATH command. Once this has been done, the machine will run as before, and, if required, the Boot directory can be deleted. Creating the userfile ===================== The file LOGNAMES.LOG in the Boot directory contains the list of all the users, and the paths of the directories assigned to various drive letters. Each line of the LOGNAMES file defines the settings for a user. The entries on each line are separated by commas. In the current implementation, there are eight entries on each line, as follows: 1 user id 2 password 3 real-word name 4 first drive path 5 second drive path 6 third drive path .. n-1 spare, suggested use: email redirection address n startup command There must be an entry for user 'root', in the following special format: root,*,Root Directory,c:\users,SUBST ,SUBST /D ,U, This entry defines the point in the directory structure from which all the other paths start from. It is the mount point for all the other entries. The drive specified in the root mount point is selected as the current drive. The password should be '*' to prevent anybody logging on as root. The first drive path entry is the mount point. This should start with a drive specifier, which will be selected as the current drive. The next two entries are the commands used to assign the drive letter to a path, and to remove an assignment. Any spaces that are needed in these commands must be present in the entries. The next entry is the list of drive letters to assign. In this example, all the user areas are in C:\users. The command 'SUBST d: pathname' will be used to assign the drive letters, and the command 'SUBST /D d:' will be used to clear an assignment. The commands can specify where the drive specifier should appear in the command by using d: at the appropriate place. For example, if the entry is 'SUBST d: \\filestore\users$\', then the Boot system will use the command 'SUBST d: \\filestore\users$\pathname'. Finally, this will set up a single drive letter, U:. There can be up to three drive letters specified in the current version. They will be assigned from the user entries left to right. So, for an example system where users are pupils in a school grouped by year, and each user has a U: drive pointing to their user area and a Y: drive pointing to their year areas, the drives entry would be YU. User Entries ------------ Each path entry will be appended to the previous one in the user entry, unless it starts with a \, when it will be appended to the mount point specified in the root entry, or it starts with d:, where it is taken as a absolute drive reference. The following is a small sample userlist: root,*,Root Point,c:\users,SUBST d: ,SUBST /D d:,YU, virus,,Virus Scanner,,c:\vkiller,,,c:\vkiller\vscan.exe # agb,,Andrew Black,year1,andrewb,,, gwh,,George Harold,year1,georgeh,,, cg,,Chris Gillot,year1,chrisg,,, jm,,James Murray,year1,jamesm,,, ph,,Paul Hughes,year1,\staff\paulh,,, # jgh,,John Harker,year2,johnh,,, cjr,,Carl Ripley,year2,carlr,,, jjr,,Jo Richardson,year2,jor,,, dwl,,Diane Lake,year2,diane,,, kga,,Keith Andrews,year2,\staff\keitha,,, # An entry that starts with a !, #, ; or | is treated as a comment. At any point whole sections of the directory structure can be moved and the userlist file just needs a few minimal changes. For example, with the above example, the users' home directories could be moved from c:\users to c:\homedirs\pupils, and all that would need changing is the root entry. In the above example, at the end of a year all the year2 pupils would become year3 pupils. This would be easily accomplished by renaming the directory year2 to year3 and changing the 'year2' entries in the userlist to 'year3'. All the other years can be moved up in a similar manner. Commands Available ================== Once BootSys is installed in the command PATH, some extra commands become available. WIN --- This will display the logon screen, log on a user, and start Windows. On exit from Windows, the logon screen is returned to for another user to log on. As BootSys is earlier in the command PATH than Windows, then when the command WIN is issued, the BootSys WIN command is run. This is only really usable with Windows 3.x as Windows 9x does not return to a calling program on exit - it just stops, waiting for the computer to be switched off. LOGON [user] ------------ This command can be used to set up the drives paths for a pre-validated user and write a LogOn entry to the logfile. LOGON will not check the validity of the supplied user, that is the responsibility of the system that issues the LOGON command. As an example, doing LOGON JGH with the example userlist listed above will set drive Y: to c:\users\year2 and drive U: to c:\users\year2\johnh and write a LogOn entry to the logfile. LOGOFF [user] ------------- This command simply writes a LogOff entry to the log file. Windows NT/Windows 2000 ======================= Windows NT4/2000 have their own user log-in system. BootSys can still be used to assign drive letters to directory paths by putting a shortcut link in the StartMenu\Programs\Startup folder. The easiest way to do this is by the following: Click on Start->Settings->Start Menu/Taskbar->Start Menu Programs->Advanced. Click on the Start Menu tab. Double-click on Programs->Startup. Right-click on Startup and select New->Shortcut. Enter the full pathname to the Logon.Bat file. If all the users share the same Windows log-on id, then just enter the full path to the Logon.bat command, for example: C:\Apps\Boot\Command\Logon.bat If each users has their own Windows log-on id, then pass that id to the Logon.bat command by appending it to the full path seperated by a space, for example: C:\Apps\Boot\Command\Logon.bat JGH Finish by clicking on Next->Finish. Right-click on the newly-created Logon entry and set the text and background colours to black, and set the 'terminate on exit' option. Also, ensure that the 'directory to start in' is set to the root of the drive, in the above example this would be 'C:\'. If all users share the same Windows id, then set 'use full screen', otherwise set 'run minimised'. Next time the computer is restarted, the Boot system will be called. If set up for all users to share a single Windows id, then it will ask for a specific system id. The users directories can be held on a networked server, as long as the server is attached to a mapped drive which is configured to reconnect on startup, and the relevant directory is referenced in the userlist. Files ===== The following files have the following information in: LOGNAMES.LOG The list of users and pathnames. LOGFILE.LOG The log file, that actions are logged to. PREWIN.BAT Contains commands to execute before Windows starts. POSTWIN.BAT Contains commands to execute after Windows exits. FIRSTRUN.BAT Contains commands to execute as the first action of the day. TITLE.TXT Title screen displayed while awaiting logon MOTD.TXT Message to display after logon processed, and before Windows starts The following files are created transiently by BootSys as it processes: STARTWIN.BAT Created to start Windows or other command. SETVARS.BAT Created to set environment variables. DATE.TXT Holds the date of last StartOfTheDay execution. Command Line Arguments ====================== The internal program LOGON.EXE which LOGON.BAT calls can take various command line options. Normally, LOGON.EXE will not need to be called directly, as the .BAT files in the Command directory provide the front-end commands needed for most purposes. Syntax: LOGON.EXE BOOTPATH [-N] [-Q] [-U USER] [-S COMMAND] The first parameter to LOGON.EXE must be the pathname to the BootSys files, ie the directory name followed by a '\'. The options have the following meanings: -N Allows Newuser logons. -Q Quiet -U USER Process for supplied pre-validated user -S COMMAND Uses the supplied command to start Windows or other application after logging on a user. The options must be in UPPER CASE, and must be in the above order. Technical Info ============== The displayed files TITLE.TXT and MOTD.TXT can change colours and move the cursor position by inserting control bytes into the text. Set text colour to n: CHR$17,CHR$n Set background colour to n: CHR$17,CHR$n+128 Move cursor to x,y: CHR$31,CHR$x,CHR$y Compatability ============= BootSys has been tested and successfully used on Windows 3.11, Windows 95 and Windows NT4. Limitations =========== BootSys does not provide any authentification of access to files or areas of filestore. All it does is conveniently assign drive letters to point to specified directories so those directories can be accessed more conveniently. It is the responsibility of other systems, such as the underlying file system or remote server system, to authenticate actual file access. Due to the way error messages are reported, LOGON has to clear the screen to remove the display. When using LOGON from Windows 95 or Windows NT, configuring Windows to run it with foreground colour=black works around this problem. Version History =============== 30-03-98 v1.15 Password requests added, screen tidied 04-04-98 v1.20 urd starts from base root 14-04-98 v1.21 newuser prompts for confirmation 17-04-98 v1.22 mount, group and user attach points 15-09-98 v1.23 fetches logdir from run command, shows MOTD 02-10-98 v1.24 disabled newid function, must enter correct ID, logon screen reads text from file 17-10-98 v1.25 runs startup command in callfile, if no '.' in command, also puts default start command at end of SETUP 02-12-98 v1.26 labels drive C to username 22-01-99 v1.27 Parses -start option 16-06-99 v1.28 Temp'y patch to run VirusScan on start-of-day 17-06-99 v1.29 PreWin, PostWin and SetVar files, FNcrypt 29-06-99 v1.30 Can be passed user name to use 30-06-99 v1.31 SUBST and drives configurable, pw="*" -> not loggable option to allow newuser logins, logs BadPW and UKUsr 28-08-99 v1.32 SUBST setting can have d: placemarker