0

I wrote a script that will log someone out of the ticketing system I use at my company, is it possible to create a script to check if the user has been idle for about 5 minutes (i.e, no keystrokes or mouse movement) one they're idle initiate the script I wrote to log them out. Once they're logged out the script would need to be restarted. But since there won't constantly be someone on submitting a ticket can you also make so it only reactivates the idle timer once someone initiates another keystroke/mouse movement?

This is my script:

@echo off
Taskkill /im firefox.exe
CD C:\Users\username\AppData\Roaming\Mozilla\Firefox\Profiles\profilename
del *"cookies.sqlite"*
CD C:\Program Files (x86)\Mozilla Firefox
start firefox.exe http://sysaid.sdairy.com/Login.jsp
Set WshShell = WScript.CreateObject("WScript.Shell")
WshShell.AppActivate("Mozilla Firefox")
WshShell.SendKeys "{ALT}", "{TAB}"

(This just closes the browser, deletes the cookies then restarts the browser in the webpage I need and alt tabs to make sure that the browser window is in front of the desktop).

Let me know if you need more information please! Thank you in advance.

Jaydon
  • 1
  • 1
  • There is no way to reactivate an idle timer in a Batch file after a keystroke/mouse movement, because there is no way to detect such events from Batch. However, it is possible to detect other events, like the presence of a file and it's creation date/time. If you can make the ticketing system report its activity via a disk file, then a Batch file can review this file and initiate an action based on it's creation time... – Aacini Oct 13 '16 at 17:56
  • Is there a different code base that can do what I need, or do you know who to make so the ticketing system sends the information you mentioned? – Jaydon Oct 13 '16 at 18:32
  • What is the code for making the idle timer? Please let me know, thank you. – Jaydon Oct 13 '16 at 18:39

0 Answers0