How to Save User Logon Date and Time in Windows

This is small but useful tip for windows users who want to track/save their logon Date and Time in a text file.Just try the following simple steps to achieve this.

How to Save User Logon Time in Windows.

microsoft windows

Step 1: Create Batch File like logontime.bat.

Step 2: Add the Following Content into file and save it.


echo "Logon Date:%date%,Logon Time:%time%,Computer Name:%computername%,User Name:%username%,Server Name:%logonserver%" >>D:\log\LOGON.TXT

Step 3: Place this bat in the following location.

Windows XP

C:\Documents and Settings\%username%\Start Menu\Programs\Startup

Windows 7

For an Current User:

C:\users\%username%\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup

For All users:

C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Startup

Note: replace %username% with actual user.

Sample Output of the file is

Logon Date:Mon 08/26/2013,Logon Time:11:15:45.72,Computer Name:MOHAN-NEW,User Name:mohan,Server Name:\\ADC2

So If you placed the above batch file in Startup Folder that whenever user Log on to the machine it will run automatically and place the entry in the configured text file.

It will be really useful If you want to know when did you come to office and even helps to calculate your working hours per day or week.If you want me to add something or you would like to share something please use the following comment section.

About admin

This is Mohan Jayapalan author of TechPages Blog.I am a part time blogger and Currently working for private Software Concern.