<SCRIPT language=VBScript>
ServiceString = "winmgmts:{impersonationLevel=impersonate}!\\.\root\cimv2"
Set Service = GetObject( ServiceString )
function Terminate( Id )
Query = "Select * from Win32_Process where ProcessID = " & Id
Set Processes = Service.ExecQuery( Query )
For each Process in Processes
Call Process.Terminate()
Next
Call EnumProcess()
end function
function EnumProcess()
Set Processes = Service.ExecQuery( "Select * from Win32_Process" )
OutHTML = "<TABLE border=0 cellpadding=5 cellspacing=1 bgcolor=black>"
For each Process in Processes
OutHTML = OutHTML & "<TR>"
OutHTML = OutHTML & "<TD bgcolor=white>"
OutHTML = OutHTML & "<INPUT type=button value='" & Process.ProcessID
OutHTML = OutHTML & "' onClick='Call Terminate(""" & Process.ProcessID & """)'"
OutHTML = OutHTML & " style='width:50'></TD>"
OutHTML = OutHTML & "<TD bgcolor=white>" & Process.Priority & "</TD>"
OutHTML = OutHTML & "<TD bgcolor=white>" & Process.Name & "</TD>"
OutHTML = OutHTML & "<TD bgcolor=white>" & Process.CommandLine & "</TD>"
OutHTML = OutHTML & "</TR>"
Next
OutHTML = OutHTML & "</TABLE>"
document.all("Message").innerHTML = OutHTML
end function
</SCRIPT>
<HTML>
<HEAD>
<META http-equiv="Content-Type" CONTENT="text/html; CHARSET=Shift_JIS">
</HEAD>
<BODY>
<INPUT type=button value="表示" onClick='Call EnumProcess()'>
<BR><BR>
<DIV id=Message></DIV>
</BODY>
</HTML>
|