CptMurphy Posted August 31, 2006 Share Posted August 31, 2006 Hello all, I'm looking for a program that will close an application after a certain amount of time has passed. For example, if a user is using a program for ~25mins, after 30mins, the application closes on him/her. It doesn't really matter if the user is notified or not. I'm mainly looking at controlling the amount of time a users spends playin an online game. I found one called CloseApp but that's shareware. I'd like a freeware one if any of you know of one. I've also heard about creating a batch file stating that a program should close. The only problem with this though, is that there'd be no way of starting a timer as soon as the user starts the game. Any help is appreciated. Link to comment Share on other sites More sharing options...
LLXX Posted August 31, 2006 Share Posted August 31, 2006 Windows has killtask and at commands, if you do a little more research you should be able to come up with a way of using those. Link to comment Share on other sites More sharing options...
ripken204 Posted August 31, 2006 Share Posted August 31, 2006 well i created an autoit3 program back when i had a crappy laptop. when i would run the sims 2, the program would kill explorer.exe, and when i exited the sims 2, explorer.exe would come back on... Link to comment Share on other sites More sharing options...
Aegis Posted August 31, 2006 Share Posted August 31, 2006 @echo offset /a %time:~3,2%+30 > tempfilefor /f %%i in (tempfile) do set closetime=%%istart calc.exe:loopif %time:~3,2%==%closetime% taskkill /f /im calc.exegoto loopThere's a bug in the loop code somewhere. Once when you can actually find it (I couldn't ) and fix it, this batch file should close calc.exe after running for 30 minutes. Link to comment Share on other sites More sharing options...
CptMurphy Posted August 31, 2006 Author Share Posted August 31, 2006 (edited) Thanks all, I really appreciate it. Special thanks to Aeigis, Ima work the code now. Thanks man.@echo offset /a %time:~3,2%+30 > tempfilefor /f %%i in (tempfile) do set closetime=%%istart calc.exe:loopif %time:~3,2%==%closetime% taskkill /f /im calc.exegoto loopThere's a bug in the loop code somewhere. Once when you can actually find it (I couldn't ) and fix it, this batch file should close calc.exe after running for 30 minutes.[EDIT]All right, I decided to use LLXX's method since it's simpler. I just created a batch file with this code @echo offtaskkill /IM dfbhd.exe /Ftaskkill /IM dfbhdlc.exe /F From here, I scheduled the task to run every 2 hours, every day, for 2 hours and 10 minutes. This should suffice it. Thanks to all who helped me. BTW, the "at" command is actually not very usefull. I just used the task scheduler. Edited August 31, 2006 by CptMurphy Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now