473,395 Members | 1,613 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

HOWTO: Kill process on remote workstation using system.management?

I found the following code:
Public Function WMIKill()

Dim colProcesses As Management.ManagementObjectSearcher

Dim colObserver As New Management.ManagementOperationObserver

Dim refProcess As Management.ManagementObject

colProcesses = New Management.ManagementObjectSearcher("SELECT * " & _
"FROM
Win32_Process " & _
"WHERE Handle
= '" & _processName & "'")
colProcesses.Scope = New Management.ManagementScope("\\" & _ws &
"\root\cimv2")
If colProcesses.Get.Count = 0 Then
Else
For Each refProcess In colProcesses.Get
Try
refProcess.InvokeMethod(colObserver, "Terminate", Nothing)
Catch ex As Exception
_errorMsg = ex.Message
End Try
Next
End If
End Function

However, the process (in this case, notepad) doesn't close.

Any help would be greatly appreciated.

TIA,
NB
Jul 21 '05 #1
0 1364

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

10
by: Fred | last post by:
There is a setting in INIT.ORA that has the unintended side-effect of making sure the ALTER SYSTEM KILL SESSION command has immediate affect. Without this setting, I've seen some instances where...
5
by: Thomas Chan | last post by:
I have an application that need to launch acrobat reader. But before I open acrobat reader, I want to check there is any existing acrobat reader opening and kill them first. What can I do? Can...
6
by: Ganesh | last post by:
Is there a utility by microsoft (or anyone) to force garbage collection in a process without have access to the process code. regards Ganesh
4
by: Prince Kumar | last post by:
I joined a company recently and they have a java program which hangs (does nothing) after a while. This is no way consistent. It could succeed quite a few times and can fail a few other times....
0
by: steven chong | last post by:
hi everyone, I need to do a query into some remote registry, workstation PCs as well as domain PCs. Previously, i was using the native WMI COM objects like this: objLocator =...
1
by: Manfred Braun | last post by:
Hi All, I am writing a tool, which should monitor some exe-processes, which are not very solid. Th main function is to re-start them, if they hung, but this is complicated. I can detect things...
1
by: james | last post by:
I am attempting to write a VB.net program to alter remote registeries. I am familiar with VBScript and so I was using WMI to connect to remote machines. How would I do this in VB.Net? I got this...
0
by: nb.home | last post by:
I found the following code: Public Function WMIKill() Dim colProcesses As Management.ManagementObjectSearcher Dim colObserver As New Management.ManagementOperationObserver Dim refProcess As...
1
by: remya1000 | last post by:
i'm tring to start a calculator in a remote machine from my system. and the codes i tried is this. Module Module1 Sub Main() Dim retValue As String retValue =...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.