Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

.bat file to append login/logout timestamp to .txt file

Status
Not open for further replies.

dcompto

Technical User
Jul 5, 2001
751
0
0
US
If this is not the right forum for this question, please let me know.

I would like to have a simple .bat file to append my login/logout timestamp to a .txt file. The login part is easy:
Code:
echo Login %date% %time% >> C:\DOCUME~1\[username]\Desktop\Login_Log.txt
but I haven't figured out the code for logOUT.

Any help is much appreciated.
 
Well, the batch command would be essentially the same (I assume that you'd want to change the word login to logout). Perhaps your question is more along the lines of how to trigger it to run? To begin to answer that question, first we must know if this is a stand alone system or a member of an Active Directory domain.
 
Perhaps the easiest way would be to use local group policy. Start, run, gpedit.msc, OK. In User Configuration, Windows Settings you will find where logon & logoff events can run custom scripts (or batch files).
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top