logip= "127.0.0.1"/Computer identification
User= ""/user Name
Password= ""//Password
Appname= "Qq.exe"//Specify the name of the program you want to close
Namespace= "root\cimv2"
WScript.Echo "Strat"
Set Wmilocator = CreateObject ("WbemScripting.SWbemLocator")
Set objwmi = Wmilocator.connectserver (Logip, namespace, user, password)
Set col =objwmi.execquery ("select * from Win32_Process where name= '" +appname+ "")
For all Colin in Col
Colin.terminate ()
Next
WScript.Echo "End"
</script>
</job>
----------------------------------------------run the specified program----------------
<job >
<script language= "VBScript" >
logip= "127.0.0.1"/Computer identification
User= ""/user Name
Password= ""//Password
Appname= "Qq.exe"//Specify the name of the program you want to start
Namespace= "root\cimv2"
WScript.Echo "Strat"
Set Wmilocator = CreateObject ("WbemScripting.SWbemLocator")
Set objwmi = Wmilocator.connectserver (Logip, namespace, user, password)
' OR
' Set processclass = GetObject (' winmgmts:win32_process ')
' RetVal = processclass.create (APPname)
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.