8

how to end a program after a predetermined time set (in minutes) as a .bat file

 3 years ago
source link: https://www.codesd.com/item/how-to-end-a-program-after-a-predetermined-time-set-in-minutes-as-a-bat-file.html
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

how to end a program after a predetermined time set (in minutes) as a .bat file

advertisements

I want to build a simple .bat file that after a predetermined set of time (like an hour or so) it will kill a program once's it's started. So say I run the batch file and after 1 hour or so it will kill another program (say firefox)


dr_andonuts has a standard way or practice I observe many do

An alternative is

batchfile content:

timeout 3600

taskkill /f /im firefox.exe

Tags batch-file

Related Articles

How to quit the program after detecting the user clicked the OK button on the UIAlertView

In my program, I have a code as below. How to exit the program after DETECTING user click OK on the UIAlertView? Thanks UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"YOur Message" message:@"Your description" delegate:self c

How to stop a program after an interval on Ubuntu

In a php file I have this: system("../my/my.sh aa.pas", $retval); system("../my/aa"); where aa is an executable file. How can I write a program that will stop execution if n seconds have passed? I want to make a judging system. It will

Best way to stop running the program after a certain time

I have following which stop execution of program after certain time. #include <iostream> #include<ctime> using namespace std; int main( ) { time_t timer1; time(&timer1); time_t timer2; double second; while(1) { time(&timer2); second =

How to end a call with a fixed time

I have written a service for handling sip call. I want to make some additional feature to restrict a call time by configuring a fix time or handling the call time value by sending with some parameter. Once a sip call got established generally it will

Django - How to call a function after a certain time

#In my views.py file def home(request): myfunc() return render(request, "home.html", {}) It takes awhile for home.html to load because it is executing the function myfunc every time that it is clicked. Is there a way to have myfunc loaded on the

How to perform a function after a specified time

I want to as if there is any way to execute a function after a specific time in windows phone 7.? For instance, see this code in android: mRunnable=new Runnable() { @Override public void run() { // some work done } now another function public void ot

How to avoid the automatic closing of the command prompt by double-clicking the .bat file in windows

I have the following commands in my .bat file and when I double click on it command prompt is closing without executing the command. cd / d: cd /projects/APP/branch rails s I have a alternate solution for it. when I drag the .bat file to command prom

How to end this program on the while loop and why does the error message print before the user input?

I am doing an assignment and I am having two problems. Thank you for any help you can offer! My first problem is terminating the program with user entry. I've gotten the program to loop upon incorrect data, but I am not sure where to put a while loop

How to end a program from a child process?

I am trying to terminate my program which takes a line that is full of commands from a file and then process each command using execvp However,Whenever I encounter quit, I want to immediately exit processing the commands and ignore all other commands

How to end an application after pressing a key and return to the Menu?

How do I create a batch file that allows the user to select an app to be run then it will prompt "Press any key to continue", after pressing any key the selected appl will be terminated and will return to the Menu? @echo off title MENU :menu cls

How to end the program in C ++

When I exit my C++ program it crashes with errors like: EAccessViolation with mesage 'Access violation at address 0... and Abnormal Program Termination It is probably caused by some destructor because it happens only when the application exits. I use

How to end the program with an exit code?

Is there a way of returning an exit code in Rust 1.0? I've tried env::set_exit_status(exit_code); but this generates a compiler error. There is also this question: Exit Rust program early which is similar but asks about the case when the process has

Programming C: How to complete the program after the user enters a sentinel value?

so I first #define SENTINEL -1 and in a certain function, I set up an if statement void blahblah(blah) { printf("Enter an integer (-1 to quit)"); scanf("%d", &value); if (value == SENTINEL) return; } but for some reason it's not te

How to run the program after an unexpected exit in Python?

I'm writing an IRC bot in Python, due to the alpha nature of it, it will likely get unexpected errors and exit. What's the techniques that I can use to make the program run again?You can use sys.exit() to tell that the program exited abnormally (gene

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK