Solved

Application Shutdown after every 30 mins

Posted on 2016-08-09
9
36 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
  • 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
 
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
Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

 
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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

This tutorial will discuss fancy secure registration forms, with AJAX technology support. In this article I assume you already know HTML and some JS. I will write the code using WhizBase Server Pages, so you need to know some basics in WBSP (you mig…
It is a general practice to get rid of old user profiles on a computer  in a LAN environment. As I have been working with a company in a LAN environment where users move from one place to some other place at times. This will make many user profil…
Learn the basics of while and for loops in Python.  while loops are used for testing while, or until, a condition is met: The structure of a while loop is as follows:     while <condition>:         do something         repeate: The break statement m…
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…

706 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

15 Experts available now in Live!

Get 1:1 Help Now