@ECHO OFF
C:
REM Switching to the C: Drive executes faster on NT/2000/XP
REM A Windows95/98/ME station's current drive is initially Drive "Z:".
IF [%OS%] == [Windows_NT] GOTO WINNTENV
IF NOT [%OS%] == [Windows_NT] GOTO WIN9XENV
:WINNTENV
SET NETCONFIG=WORKSTATION
SET PERSISTENT=PERSISTENT:
IF EXIST \\%COMPUTERNAME%\ADMIN$\* SET NETTIME=/SET /YES
GOTO ACCESS
:WIN9XENV
SET OS=Windows_9x
SET NETCONFIG=/YES
SET NETTIME=/SET /YES
GOTO ACCESS
:ACCESS
SET DEPT=\\NTSERVER\Reserved
SET MANAGERS=\\NTSERVER\Reserved
SET EXECUTIVE=\\NTSERVER\Reserved
IF EXIST \\NTSERVER\Sales$\* SET DEPT=\\NTSERVER\Sales
IF EXIST \\NTSERVER\Acct$\* SET DEPT=\\NTSERVER\Acct
IF EXIST \\NTSERVER\Managers$\* SET MANAGERS=\\NTSERVER\Managers
NET USE M: /DELETE > NUL
NET USE M: %MANAGERS%$ /%PERSISTENT%YES > NUL
ECHO M: %MANAGERS%
NET USE O: /DELETE > NUL
NET USE O: %DEPT%$ /%PERSISTENT%YES > NUL
ECHO O: %DEPT%
REM In the commands below, NT/2000/XP automatically performs the mapping of Drive U: to the User, according to their <Profile> in "User Manager for Domains". The command "NET USE U: /HOME /YES" is only required for Windows9x Class stations. On WindowsNT/2000/XP, the U: Drive is ALREADY MAPPED and IN-USE and the CURRENT DRIVE\DIRECTORY (however, we did switched it to C: at the top of this Script). So NT Class stations should not execute it, otherwise your Domain Logon Script will display an error.
IF [%OS%] == [Windows_9x] NET USE U: /HOME /YES > NUL
ECHO U: \\NTSERVER\%USERNAME%
REM The ECHO command above will only display a complete directory on an NT Class station and simply "U:\NTSERVER\" on a 9x Class station.
:WELCOME
ECHO. Welcome...
NET TIME \\NTSERVER %NETTIME% | FIND /I "Current Time"
:LOG
NET TIME \\NTSERVER >> U:\NTLOGON.LOG
ECHO %OS% >> U:\NTLOGON.LOG
NET USE | FIND /I "U:" >> U:\NTLOGON.LOG
NET CONFIG %NETCONFIG% >> U:\NTLOGON.LOG
FOR %%Z IN (%PATH%) DO IF EXIST %%Z\IPCONFIG.EXE %%Z\IPCONFIG.EXE %IPCONFIG% >> U:\NTLOGON.LOG
ECHO.══════════════════════════════════════════════════════════════════════ >> U:\NTLOGON.LOG