> Any new ideas for small utilities?
I had one.
I found no little nifty GUI utillity for to
close an application
by name or handle at an given time.
I had to wrote an batch and use an other timer tool.
Maybe this is an idea, or have anyone such an tool?
I searched something like this:
------------------------------------------------------------------------------------
Project name [ INetRadio ] [Save] [Load]
--------------------
Windows title (with regex ) [ INetRadio* ] [list current titels...]
Program handle [ ] [list current handles...]
--------------------
( ) close only first occurrence
( ) close all match
--------------------
(x) Close in [ 45] [Minutes] (Hour, days)
( ) Close at [21:59] [Daily,Weekly, Monthly]
(or use a kind of cron syntax)--------------------
Check if closed every [ 45] [Minutes] (Hour, days)
[X] Kill after [ 3] Minutes if not closed
--------------------
( ) Execute this after schedule [ shutdown.cmd] [...]
------------------------------------------------------------------------------------
This is my batch
This work for me (on Win2000), maybe not for your environment !?
Be carefull.
If you want, copy and paste this code in an text file,
name it what you want with the extension .cmd (or .bat for Win98)
and use your Win Taskplaner to schedule this batch.
NOTE: we need pv.exe (PrcView command line utility) from Igor Nys, found at http://www.prcview.com/
Download and unpack PrcView.zip.
Copy pv.exe in an folder in the path, or in the folder of this batch.cmd
This batch could be used for all apps, that's why there are further infos in it.
Enjoy.
@echo off
:: stopScreamer.cmd
:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: Little batch to close any application (Process) with an scheduler June 2005 by Stefan
:: NOTE: we need pv.exe (PrcView command line utility) from Igor Nys, found at http://www.prcview.com/
:: Download and unpack PrcView.zip.
:: Copy pv.exe in an folder in the path, or in the folder of this batch.cmd
:: Then use Windows Taskplaner or your favorite cron utillity to schedule this batch
:: (to close the process on a time YOU want)
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: which process to close or kill ?
:: wrote the process name behind the equals sign '=' in the line below
set processname=screamer.exe
:: thats all you have to do, just save and than schedule this batch or start it per double click
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: now it's my part from here, hands off !
:1: first we look if the process is there or not, to avoid error messages of the pv.exe
pv.exe %processname% >nul
if ERRORLEVEL 1 goto _ERROR_MESSAGE
::::::::::::::::::::::::::::::::::::::::
:2: than we try to close (end) the process
pv -close %processname%
::::::::::::::::::::::::::::::::::::::::
:3: now we wait 5 seconds (-n 5) to allow the process to terminate
ping 127.0.0.1 -n 5 >NUL
::::::::::::::::::::::::::::::::::::::::
:4: let's take a look if the process is not follow our advise and is still running
pv.exe %processname% >nul
::
:: if it not run, we go to an success message
if ERRORLEVEL 1 goto _OK_MESSAGE
::
:5: else we kill the process, no mercy! (Note: lost of current data may occur)
pv -kill %processname%
goto _END
::::::::::::::::::::::::::::::::::::::::
:_ERROR_MESSAGE
ECHO ! ! ! A T T E N T I O N ! ! !
ECHO We have no process found with the given name: %processname%.
ECHO That means %processname% is not running
ECHO or you have maybe an typo in this name, please check this, i give up.
goto _END
:_OK_MESSAGE
ECHO --------------------------------------------
ECHO Done. %processname% is not running anymore.
ECHO Bye.
:_END
set processname=
:: Note: delete PAUSE if you need no infos any more
PAUSE
-
iam dream about something like this: