How to automatically close a idle application in a user session

Posted on 2011-05-12
Last Modified: 2012-05-11

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?

Question by:Mobsterkid
    1 Comment
    LVL 10

    Accepted Solution

    I don't know if this will work for you. Costomize it and give it a try.

    SET Program=notepad.exe
    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 >NUL
    IF "%~1" NEQ "" (
    	IF [%Flag%] == [%~1] TASKKILL /F /PID %~2
    	SET Flag=%~1
    EXIT /b

    Open in new window


    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Better Security Awareness With Threat Intelligence

    See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

    A short article about a problem I had getting the GPS LocationListener working.
    Whether you’re a college noob or a soon-to-be pro, these tips are sure to help you in your journey to becoming a programming ninja and stand out from the crowd.
    An introduction to basic programming syntax in Java by creating a simple program. Viewers can follow the tutorial as they create their first class in Java. Definitions and explanations about each element are given to help prepare viewers for future …
    In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

    759 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    14 Experts available now in Live!

    Get 1:1 Help Now