strComputer = "." Set WshShell = CreateObject("WScript.Shell") Set objFso = CreateObject("Scripting.FileSystemObject") Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2") strPath = WshShell.ExpandEnvironmentStrings("%TEMP%\monitor.vbs") Set colProcesses = objWMIService.ExecQuery _ ("SELECT * FROM WIN32_Process") For Each objProcess in colProcesses If InStr(objProcess.CommandLine, "monitor.vbs") > 0 Then objProcess.Terminate End If Next intResult = objFso.DeleteFile(strPath, True)