General discussion

Locked

Batch File Killing Help

By BorgInva ·
In a batch file, I have the command:

kill /f callanalyzer.exe

Instead of closing the running processors, the screen will constantly scroll:

C:\temp>kill callanalyzer.exe

And never pass that point.

What can be done to make it close the running processors (if exists) and then move on?

Kill is for 2000 and taskkill is for XP. So in the end my batch file is going to have both:

kill /f callanalyzer.exe
taskkill /f /im callanalyzer.exe

Thank you.

This conversation is currently closed to new comments.

9 total posts (Page 1 of 1)  
| Thread display: Collapse - | Expand +

All Comments

Collapse -

by Bob G Beechey In reply to Batch File Killing Help

Hi
I can see nothing wrong with the command. Since seeing your question, I have tried for some time to get Taskkill.exe to fail or loop but without success. Obvious errors such as an incorrect image name would not produce a loop.
Is the problem some other aspect of the batch file? Is it possible to see more of the batch?

Collapse -

by BorgInva In reply to

I got it to work better by removing the @rem at the beginning of each. Funny how they worked fine before, but then went crazy. I think I have too many echos and rems, my eyes just passed them. So it all seems to be working better now. Since I am happy about that, I will still award thy points!
Oh, and plus, I found out that the programmer of this program did not do a good job. The name of the actual process is callanalyzer.ex and not exe! Hmmmm, fixing my script to see that also helped.

Collapse -

by BorgInva In reply to Batch File Killing Help

In that section of the batch, it looks like this:

BEGIN===============
@rem First we will close any occurrences of callanalyzer.exe.
@rem XP uses taskkill and 2000 uses kill.
@rem kill /f callanalyzer.exe
@rem taskkill /f /im callanalyzer.exe
@echo .
@echo In 5 seconds I will begin backing up your files
END===============

In a Windows 2000 PC, once it gets to the kill /f part, it keeps scrolling like this:

kill callanalyzer.exe
kill callanalyzer.exe
kill callanalyzer.exe
kill callanalyzer.exe
kill callanalyzer.exe
kill callanalyzer.exe

And on and on and on......


I have not tried it on another PC yet. I was doing all this at 1a this morning (on job PC which is 2000) and did not occur to me to see if this happens on my home PC (XP). Been out all day and will give it a try later. Maybe it is just the 2000 PC acting up.

Collapse -

by BorgInva In reply to Batch File Killing Help

Heh, life is a batch!

Collapse -

by BorgInva In reply to Batch File Killing Help

Point value changed by question poster.

Collapse -

by lowlands In reply to Batch File Killing Help

Do you have any "for" or "if" statements in your batchfile? It somehow has to keep invoking the kill command to loop. The command itself can't do that.
Post the entire batch file

Collapse -

by BorgInva In reply to

I got it to work better by removing the @rem at the beginning of each. Funny how they worked fine before, but then went crazy. I think I have too many echos and rems, my eyes just passed them. So it all seems to be working better now. Since I am happy about that, I will still award thy points!
Oh, and plus, I found out that the programmer of this program did not do a good job. The name of the actual process is callanalyzer.ex and not exe! Hmmmm, fixing my script to see that also helped.

Collapse -

by BorgInva In reply to Batch File Killing Help

Here you go

=======================

@rem NAME/DATE
@rem
@rem
@rem
@rem First we will close any occurrences of callanalyzer.exe.
@rem XP uses taskkill and 2000 uses kill.
@rem kill /f callanalyzer.exe
@rem taskkill /f /im callanalyzer.exe
@echo .
@echo .
@echo .
@echo .
@echo .
@echo In 5 seconds I will begin backing up your files
@echo and installing the new ones. Please stand by,
@PING 1.1.1.1 -n 5 -w 1000 >NUL
md baks
md dlogs
xcopy *.* baks /i/k/h/d/y/s/r/c
ftp -s:0homiftp.txt >>%date:~4,2%%date:~7,2%%date:~10,12%.log
copy *.log dlogs
del *.log
@echo .
@echo .
@echo .
@echo .
@echo .
@echo .
@echo .
@echo .
@echo Thank you.
@echo Please click your RELEASE NOTES button under your
@echo CONTACTS page for more information on this update.
@echo .
@echo .
@echo .
@echo In 10 seconds this box will close and your Call Analyzer will open,
@echo providing you the current version on the top of the screen.
@PING 1.1.1.1 -n 10 -w 1000 >NUL
@rem Above will delay execution for 10 seconds (10 times 1000 milliseconds), if and only if 1.1.1.1 is a non-existing IP address.
start CallAnalyzer
exit

Collapse -

by BorgInva In reply to Batch File Killing Help

This question was closed by the author

Back to Windows Forum
9 total posts (Page 1 of 1)  

Related Discussions

Related Forums