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

Application Shutdown after every 30 mins

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
Shailesh Shinde
Asked:
Shailesh Shinde
  • 3
  • 3
  • 2
  • +1
1 Solution
 
KimputerCommented:
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
 
Benjamin VoglarCommented:
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
 
Manuel FloresCommented:
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
Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

 
KimputerCommented:
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
 
Benjamin VoglarCommented:
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
 
Shailesh ShindeLocalization Engineering & AutomationAuthor Commented:
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
 
KimputerCommented:
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
 
Shailesh ShindeLocalization Engineering & AutomationAuthor Commented:
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
 
Benjamin VoglarCommented:
This is what user wanted.
0

Featured Post

How to Use the Help Bell

Need to boost the visibility of your question for solutions? Use the Experts Exchange Help Bell to confirm priority levels and contact subject-matter experts for question attention.  Check out this how-to article for more information.

  • 3
  • 3
  • 2
  • +1
Tackle projects and never again get stuck behind a technical roadblock.
Join Now