thanks for the input OldDog. The problem though is that I would'nt know
'when' to kill the process. It runs asynchronously from my main script. I do
appreciate your response though. Thanks.
On Sep 19, 2:58 pm, "James" <no...@nowhere.com> wrote:
You will probably need to Kill the Diskpart process after you quit.
' ProcessKillLocal.vbs
' Sample VBScript to kill a program
' Author Guy Thomas
http://computerperformance.co.uk/
' Version 2.7 - December 2005
' ------------------------ -------------------------------'
Option Explicit
Dim objWMIService, objProcess, colProcess
Dim strComputer, strProcessKill
strComputer = "."
strProcessKill = "'calc.exe'" <---- Diskpart.exe goes here
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" _
& strComputer & "\root\cimv2")
Set colProcess = objWMIService.ExecQuery _
("Select * from Win32_Process Where Name = " & strProcessKill )
For Each objProcess in colProcess
objProcess.Terminate()
Next
WSCript.Echo "Just killed process " & strProcessKill _
& " on " & strComputer
WScript.Quit
' End of WMI Example of a Kill Process