Firts sorry for my bad English (I'm Spanish) and sincerly thanks for read
this.
My problem is the next; this vbscript code work fine directly from a .vbs
file in Win2k Sp4 and VBS 5.6:
Dim objWMIService, objProcess, colProcessList, proceso
proceso = "notepad.exe"
Set objWMIService =
GetObject("winmgmts:{impersonationLevel=impersonate}!\\tsystems1\root\cimv2"
)
Set colProcessList = objWMIService.ExecQuery ("Select * from Win32_Process
Where Name = 'notepad.exe'")
For Each objProcess in colProcessList
objProcess.Terminate()
Next
msgbox "Proceso Parado"
But if it is integrated in to a IE form:
<html><head><title>Listando Procesos</title>
<SCRIPT LANGUAGE="VBScript">
Sub x1692
Dim objWMIService, objProcess, colProcessList, proceso
proceso = "notepad.exe"
Set objWMIService =
GetObject("winmgmts:{impersonationLevel=impersonate}!\\equipo\root\cimv2")
Set colProcessList = objWMIService.ExecQuery ("Select * from Win32_Process
Where Name = 'notepad.exe'")
For Each objProcess in colProcessList
objProcess.Terminate()
Next
msgbox "Proceso Parado"
End Sub
<tr><td width='20%'>notepad.exe</td><td width='10%'>1692</td><td
width='50%'>C:\WINNT\system32\notepad.exe</td>
<td width='20%'><FORM name="frmone"><INPUT TYPE="BUTTON" value="Parar"
NAME="x1692" onclick="x1692"></FORM></td></tr>
</table></body>
</html>
D'ont show errors and no msgs appears and I stay sure that the code is ok.
My questions are;
Have win2k any security patch that make impossible execute
this code in IE form?
Anyone know how will do for execute it whitout this
problem?