I need to be able to kill a process using some sort of batch file

  • Thread starter Thread starter myk
  • Start date Start date
M

myk

(insert subject). The thing is, the PID changes with each launch.

At my work, we use a remote control utility that, for some reason,
doesn't kill the process every time we choose "Exit" from the File
menu. So, we have to go into the task manager and kill the process. Is
there any easy way to do this?

I don't have access to any dev tools, I can't use any external apps
(downloaded), so I'm kind of restricted to any Windows function or DOS
..bat file or something that can perform this. As I said, the PID
changes every time we launch the app, but the image name is always the
same and unique in this environment.

Thanks in advance.
 
See tskill and taskkill whichever you may have.

You can also use WMI in a VBS script Just make sure your work is saved
before running any of these.

Example:
' killOutlook.vbs
set wmi = getobject("winmgmts:")
wql = "select * from Win32_Process " & " where name='outlook.exe'"
set results = wmi.execquery(wql)
for each app in results
app.terminate
next
 
Also this one.

http://www.sysinternals.com/ntw2k/freeware/pskill.shtml

--
Regards,

Dave Patrick ....Please no email replies - reply in newsgroup.
Microsoft Certified Professional
Microsoft MVP [Windows]
http://www.microsoft.com/protect

:
| (insert subject). The thing is, the PID changes with each launch.
|
| At my work, we use a remote control utility that, for some reason,
| doesn't kill the process every time we choose "Exit" from the File
| menu. So, we have to go into the task manager and kill the process. Is
| there any easy way to do this?
|
| I don't have access to any dev tools, I can't use any external apps
| (downloaded), so I'm kind of restricted to any Windows function or DOS
| .bat file or something that can perform this. As I said, the PID
| changes every time we launch the app, but the image name is always the
| same and unique in this environment.
|
| Thanks in advance.
 
Paul R. Sadowski said:
See tskill and taskkill whichever you may have.

You can also use WMI in a VBS script Just make sure your work is saved
before running any of these.

Example:
' killOutlook.vbs
set wmi = getobject("winmgmts:")
wql = "select * from Win32_Process " & " where name='outlook.exe'"
set results = wmi.execquery(wql)
for each app in results
app.terminate
next

the code worked perfectly. thanks!!
 
Back
Top