Solved

Application Shutdown after every 30 mins

Posted on 2016-08-09
9
44 Views
Last Modified: 2016-08-29
Hi All,

Is there a way to shutdown the application on windows after every 30 mins if open.
This requirement is basically for the application which has time limit subscription or license and user complete the work but forget to close or shutdown the application.

Thanks,
Shail
0
Comment
Question by:Shailesh Shinde
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 3
  • 2
  • +1
9 Comments
 
LVL 35

Expert Comment

by:Kimputer
ID: 41748610
Wow, that's harsh, what if they're mid-entry of a big text field?

Anyway, you can have the start icon in only one place, and let it be VBscript (start program, start timer, end timer with killing the process).

If you are writing the program yourself, build in the timer yourself (have warning screens towards the end of the timer).
0
 
LVL 12

Expert Comment

by:Benjamin Voglar
ID: 41748613
I will give you a example for notepad.exe with powershell.

Get-Process -Name notepad | Stop-Process -Force

Open in new window


just save this line in a .ps1 file and schedule it that it will run every 30 min,

https://support.software.dell.com/appassure/kb/144451
0
 
LVL 5

Expert Comment

by:Manuel Flores
ID: 41748619
Maybe I would try some kind of macro recorder which after a given time will;

1. Focus the application.
2. Press the keyboard shortcut to quit the application (operating system dependent).

Once started again the application, run the macro again.  In fact you could launch the application by macro instruction.

I user this in my mac; https://www.keyboardmaestro.com/main/

Macro example;

Macro example
Will check if there are something similar por Windows.
0
Guide to Performance: Optimization & Monitoring

Nowadays, monitoring is a mixture of tools, systems, and codes—making it a very complex process. And with this complexity, comes variables for failure. Get DZone’s new Guide to Performance to learn how to proactively find these variables and solve them before a disruption occurs.

 
LVL 35

Expert Comment

by:Kimputer
ID: 41748620
Above is of course a solution. BUT IF you schedule it for every 30 minutes, you risk a person working on it for one minute already being kicked out. (for instance, every 7.00, 7.30, 8.00, 8.30 etc it will close the app, think about a person starting the app at 8.29)
1
 
LVL 12

Accepted Solution

by:
Benjamin Voglar earned 500 total points (awarded by participants)
ID: 41748635
OK,  I agree.

I wrote a little script that will kill "notepad" application if the application is running more then 30 min.

You can schedule the task to ran the script every minute,

$time = New-TimeSpan -Start (get-process notepad).StartTime

if ($tim.minutes -lt 30) {


Get-Process -Name notepad | Stop-Process -Force


}

Open in new window

0
 
LVL 3

Author Comment

by:Shailesh Shinde
ID: 41749972
Hi,
Yes, the concerned has been raised by the dept. for the issue of loosing the data if user were working.
Can this be possible to check if the application is idle than close it or no action required.
However, from where I will get this info of idle or busy application?

Thanks,
Shail
0
 
LVL 35

Expert Comment

by:Kimputer
ID: 41750011
You can't really get that information.
Alternative methods (both unreliable):

- check if window is active (doesnt mean it's idle or not, just if it's the window is the active one, can't check if the user typed in the active window or not)
- check cpu usage (totally unreliable for programs that use very little CPU, even when user is typing it in, or when program uses some CPU even if idle)
0
 
LVL 3

Author Comment

by:Shailesh Shinde
ID: 41769842
Hi,
I have tried these options with the help of system admin.

- check if window is active (doesnt mean it's idle or not, just if it's the window is the active one, can't check if the user typed in the active window or not)
- check cpu usage (totally unreliable for programs that use very little CPU, even when user is typing it in, or when program uses some CPU even if idle)

But it does not give the CPU usage correctly as mentioned above and can't depend on these values really.

Thanks,
Shail
0
 
LVL 12

Expert Comment

by:Benjamin Voglar
ID: 41774466
This is what user wanted.
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This tutorial will discuss the log-in process using WhizBase. In this article I assume you already know HTML. I will write the code using WhizBase Server Pages, so you need to know some basics in WBSP (you might look at some of my other articles abo…
How to remove superseded packages in windows w60 or w61 installation media (.wim) or online system to prevent unnecessary space. w60 means Windows Vista or Windows Server 2008. w61 means Windows 7 or Windows Server 2008 R2. There are various …
Learn the basics of strings in Python: declaration, operations, indices, and slicing. Strings are declared with quotations; for example: s = "string": Strings are immutable.: Strings may be concatenated or multiplied using the addition and multiplic…
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.

696 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