Welcome guest. Before posting on our computer help forum, you must register. Click here it's easy and free.

Author Topic: need help with a batch file that tells you last time you were on  (Read 6257 times)

0 Members and 1 Guest are viewing this topic.

reevey

  • Guest
hi.i have a little batch adventure game and there is a "info" screen.i want (if at all possible)it to display the time and date it was last used.i am new to this and will appreciate it if you could offer me an example code or tell me how to do it because i am trying to practice my skills.thanks
« Last Edit: February 20, 2014, 05:19:05 PM by reevey »

foxidrive



    Specialist
  • Thanked: 268
  • Experience: Experienced
  • OS: Windows 8
Re: need help with a batch file that tells you last time you were on
« Reply #1 on: February 20, 2014, 06:46:23 PM »
Make your code create a txt file when it runs.

You can then get the timestamp of that file next time and which will show you the date and time.

Code: [Select]
for %%a in ("file.txt") do echo %%~ta

reevey

  • Guest
Re: need help with a batch file that tells you last time you were on
« Reply #2 on: February 20, 2014, 08:26:40 PM »
thanks for the help but i think i figured it out. i just make it execute this code on the exit tab in my game and right after the 5 second timer it will print the time and date onto the .txt
Code: [Select]
echo PLay: %time% %date%>>gameplay.txt