• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1206
  • Last Modified:

How to automatically close a idle application in a user session

Hi,

We have a ERP(Sage ACCPAC) software that use a per user license. The problem is that my users are opening the software and leaving it open even when there not using it. This is costing me a lot of money on licenses and I want to try and reduce this number. I cant use session timeout because they may be active on other applications.

Is there a way to monitor this idle application in TS 2008 R2 and automatically close(force) it on timeout?

Thanks!
0
Mobsterkid
Asked:
Mobsterkid
1 Solution
 
ReneGeCommented:
I don't know if this will work for you. Costomize it and give it a try.

 
@ECHO OFF

SET Program=notepad.exe

:HOME
REM kernelModeTime:%%A PricessID:%%B
FOR /F "skip=1 tokens=1,2 delims= " %%A in ('WMIC PROCESS WHERE ^(Name^="%Program%"^) get KernelModeTime^, ProcessId') DO CALL :TESTING "%%A" "%%B"
PING -n 600 127.0.0.1 >NUL
GOTO HOME

:TESTING
IF "%~1" NEQ "" (
	IF [%Flag%] == [%~1] TASKKILL /F /PID %~2
	SET Flag=%~1
)
EXIT /b

Open in new window

0

Featured Post

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now