Well, normally this is done by using different logon scripts. You assign student.bat to the student user accounts, and teacher.bat to the teacher accounts. You don't have to use the same logon script for all accounts.
But, if you still want to knowa way, then there is one. There is a variable called %USERNAME% that you can use. This variable will = the user name that the user typed into the User Name box in the logon window.
For example, say you have user BOB who is a teacher, user TOM who is a student, and user JIM who is another teacher. All 3 users use LOGON.BAT as their logon script. The beginning of LOGON.BAT looks like this:
@echo off
IF %USERNAME% == BOB CALL TEACHER.BAT
IF %USERNAME% == bob CALL TEACHER.BAT
REM continue with students logon script drive mappings and such....
So, those IF %USERNAME% lines say if BOB logs in, then call ANOTHER batch file called TEACHER.BAT and do whatever TEACHER.BAT says to do. Now, the %USERNAME% variable IS case-sensitive, so "BOB" and "bob" both need to be in. From my experience, those are the normal user names that people use, either all capitals or all lower case. You normally don't see people logging in with user name "Bob".
Now, the TEACHER.BAT file has all of the logon script parameters for teachers. The very IMPORTANT thing to remember about TEACHER.BAT is that the very last line in that BAT file must be this:
EXIT
If you do not have the EXIT at the end of TEACHER.BAT, then the logon script process will continue AFTER TEACHER.BAT has finished, and it will go back to LOGON.BAT and continue doing stuff! If you EXIT at the end of TEACHER.BAT, that will end the whole session at that point; it won't loop back to LOGON.BAT and continue.
Last, the rest of LOGON.BAT has the logon script info for the students.