Solved

Vbscript question : How can an executable be killed,  using vbscript.

Posted on 2006-06-21
3
213 Views
Last Modified: 2010-04-17
please help.
0
Comment
Question by:itbabe
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 14

Expert Comment

by:StillUnAware
ID: 16952136
see taskkill command
0
 
LVL 5

Expert Comment

by:shtson
ID: 16952378
Hai2u,

as StillUnAware said,

Sample 1: (by process name)
Public Sub Foo()
    Shell "TASKKILL /IM notepad.exe"
End Sub

Sample 2: (by process id)
Public Sub Foo()
    Shell "TASKKILL /PID 1283"
End Sub

Cheers,
Shai

0
 
LVL 2

Accepted Solution

by:
TiwariVikas earned 500 total points
ID: 16952782
TaskKill is a wonderful exe but it is not present in Win2000 or earlier.

Alternatively, you can use WMI to kill a process...

strComputer = "."
Set objWMIService = GetObject("winmgmts:" _
    & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")

Set colProcessList = objWMIService.ExecQuery _
    ("Select * from Win32_Process Where Name = 'Notepad.exe'")

For Each objProcess in colProcessList
    objProcess.Terminate()
Next

Regards,
Vikas.
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
How to obtain Administrator permission when you are the Administrator 6 102
Math Equation 23 123
Selenium docs api java index 3 64
storing csv file in table variable in Python 2 60
This article will show, step by step, how to integrate R code into a R Sweave document
This is an explanation of a simple data model to help parse a JSON feed
In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…

756 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question