?
Solved

Application Shutdown after every 30 mins

Posted on 2016-08-09
9
Medium Priority
?
52 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 36

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
TCP/IP Network Protocol Cheat Sheet

TCP/IP is a set of network protocols which is best known for connecting the machines that make up the Internet. The truth is that TCP/IP is one of the oldest network protocols and its survival is mainly based on its simplicity and universality.

 
LVL 36

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 2000 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 36

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

A new era in Cloud training has arrived.

A day that will go down in Cloud history.. But are you ready for it? Will you accept this Cloud challenge?

Question has a verified solution.

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

This article is meant to give a basic understanding of how to use R Sweave as a way to merge LaTeX and R code seamlessly into one presentable document.
This article will show, step by step, how to integrate R code into a R Sweave document
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…
In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…
Suggested Courses

777 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