(view source code of login_log_access.bat as plain text)
:: Get current date in YYYYMMDD format if possible (XP Professional or later)FOR /F "skip=1 tokens=1-3" %%A IN ('WMIC Path Win32_LocalTime Get Day^,Month^,Year /Format:Table') DO (
SET /A Today = 10000 * %%C + 100 * %%B + %%A
)IF ERRORLEVEL 1 SET Today=
:: In case WMIC did not get the "sorted" date we'll have to get an "unsorted" date in regional date formatIF "%Today%"=="" (
REM Strip the leading day of the week from the dateFOR %%A IN (%Date%) DO SET Today=%%A
REM Remove the date delimitersSET Today=%Today:/=%
SET Today=%Today:-=%
):: Create a directory for today if it does not existIF NOT EXIST \\Server\Logs\%Today% MD \\Server\Logs\%Today%
:: Log the computer name and the date and time in a file with the user's name>> \\Server\Logs\%Today%\%UserName%.log ECHO %ComputerName%,%Date%,%Time%
page last modified: 2025-10-11; loaded in 0.0047 seconds