I have a scenario where I want to detect the mouse movement when movement happens with certain timing slot and it is a first-time movement happened of the mouse when I logged in then catch the current date and time and store to file
Below code works fine:
@echo off
for /f "tokens=1,2" %%u in ('date /t') do set d=%%v
for /f "tokens=1" %%u in ('time /t') do set t=%%u
if "%t:~1,1%"==":" set t=0%t%
For /f "tokens=1,2,3,4,5 delims=/. " %%a in ('date/T') do set dt=%%c-%%b-%%d
set logfile=C:\Users\vvoor\OneDrive\Desktop\wirite\n\login_time_%dt%.txt
echo Login Time : %d% %t% %time:~-5,2% >> %logfile%
This above works fine as expected gives me date and time
But I want the script should automatically trigger and capture the date and time when I log in for the first time and move his mouse for the first time
The time slot is between 12:00 to 2:00 => if mouse movement happen for first time within given time slot then capture current date and time to a text file