Start a program 'n' kill a process

June 10, 2010 at 17:41:15
Specs: Windows XP
Hi,

The reason I'm writing is that our support team isn't quite what it should be.

I use the program "Cisco Desktop Agent"
(CAD) at work, to control my Cisco VoIP
phone. Well every time I start the program it
runs a process called "Update.exe". This
process is a pain because it holds me at least 7mins up from logging in. On the end it gives me a
error message that it can't download
something or what not. So I have to start CAD
and then the Taskmanager to kill that
"Update.exe" process, in order to save me
time. I've escalated this issue countless times
but yeah...

What I would like to do is (if its possible)
create a batch file or something like that. To start CAD for me and then kills the process when it shows up a second or two in the process list.
I would really appreciate any ideas on how to
make work life a little easier ... LOL!

greetz!
*rob


See More: Start a program n kill a process

Report •


#1
June 10, 2010 at 19:34:39
you might try swapping out some simple exe program and name it update.exe (in the correct location of course).
prob'ly won' work, but who knows? it's just a damn downloader.
other method:
:10
taskkill /im update.exe /t || goto :10
::------- end snippet
the /t may or may not be need or wanted. none of this tested.

Report •

#2
June 10, 2010 at 20:12:28
Hey Rob,
Try this:

:: Stop.Update.bat
@ECHO OFF
SETLOCAL 

:Start_CAD
START "" "%PROGRAMFILES%\Cisco\Desktop\bin\agent.exe" 

:Find_Update_Process
PING 127.0.0.1 -n 5 >NUL
FOR /F "tokens=1,2* delims=:" %%A IN ('TASKLIST /V /FO "LIST" /FI "IMAGENAME EQ UPDATE.EXE"') DO (
	IF "%%A" EQU "PID" (
		SET PID=%%B
	)
)

IF DEFINED PID (
	TASKKILL /PID %PID% /F /T
) ELSE (
	GOTO Find_Update_Process
)

EXIT /B

I'm only guessing the name of the program that starts "CAD"
based on a quick google search, and the name of the update
program. I'll let you verify those...


Report •

#3
June 11, 2010 at 00:54:15
wow guys ... thanks a lot for the quick response!!! ya'll rock!

@ orangeboy - so let me see if i have it right ... i switch out

"%PROGRAMFILES%\Cisco\Desktop\bin\agent.exe"

with the actual path of the program (what i checked and it is
the right one you got). i really can' t identify what else i would
edit.
but basically i copy/paste the script in to an editor and save it
as a batch file correct?!


Report •

Related Solutions

#4
June 11, 2010 at 01:00:45
so it would like this in the batch file...

@ECHO OFF
SETLOCAL

START ""
"%PROGRAMFILES%\Cisco\Desktop\bin\agent.exe"

PING 127.0.0.1 -n 5 >NUL
FOR /F "tokens=1,2* delims=:" %%A IN ('TASKLIST /V /FO
"LIST" /FI "IMAGENAME EQ UPDATE.exe"') DO (
IF "%%A" EQU "PID" (
SET PID=%%B
)
)

IF DEFINED PID (
TASKKILL /PID %PID% /F /T
) ELSE (
GOTO Find_Update_Process
)

EXIT /B


Report •

#5
June 11, 2010 at 06:42:28
START ""
"%PROGRAMFILES%\Cisco\Desktop\bin\agent.exe"

Should all be on one line (could be a formatting error with this
forum). If there is a shortcut to "Cisco Desktop Agent", you
can right-click on the icon> properties and find the path to the
program.

But yes, copy everything from:

:: Stop.Update.bat

to
EXIT /B

and paste into notepad. Save as
File name: Stop.Update.bat
Save as type: All files

Report •

#6
June 15, 2010 at 16:44:43
@ orangeboy

sorry i got so late back @ ya!

it works ... THANK YOU SO MUCH BUDDY!!!

you rock! \m/ >.< \m/


Report •

#7
June 15, 2010 at 19:00:30
Glad to hear it! I use the "tasklist/taskkill" twice daily with a
process so I can clean up some log files the process has
locked. Your situation sounded like it could be handled in
(roughly) the same way ;-)

Report •


Ask Question