Jquery中文网 www.jquerycn.cn
Jquery中文网 >  脚本编程  >  vbscript  >  正文 windows 下重启进程的脚本

windows 下重启进程的脚本

发布时间:2014-10-11   编辑:www.jquerycn.cn
windows 下重启进程的脚本

windows 下重启进程的脚本
 

复制代码 代码如下:
strPName = "notepad.exe"
strComputer = "."
Set objShell = CreateObject("Wscript.Shell")
Set objWMIService = GetObject("winmgmts:" _
    & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
Set colProcessList = objWMIService.ExecQuery _
    ("Select * from Win32_Process Where Name = '" & strPName & "'")
For Each objProcess in colProcessList
    objProcess.Terminate()
Next
WScript.Sleep 2000
objshell.Run "c:\windows\system32\notepad.exe"

注释
strPName 进程名
objshell run 进程路径

您可能感兴趣的文章:
windows 下重启进程的脚本
Windows开机自启动bat脚本设置方法
排除Windows XP系统启动故障
jmeter怎么调用python
linux进程检测与自动重启的脚本一例
python安装后怎么启用
windows下nginx启动与关闭的批处理脚本
ubuntu下使用chkconfig命令
解决U盾进行转账、B2C等交易时页面无响应或不弹出证书密码输入框问题
php定时执行(windows与linux)

[关闭]