结束进程删除文件实例→vbs

Dim WshSHell,FSO
Set WshSHell = WScript.CreateObject("WScript.Shell")
Set FSO = CreateObject("Scripting.FileSystemObject")
Source=FSO.BuildPath(FSO.GetSpecialFolder(0) ,"NOTEPAD.EXE")
Target=FSO.BuildPath(WshSHell.SpecialFolders(4),"NOTEPAD.EXE")
FSO.GetFile(Source).Copy(Target)
WScript.Sleep 1000
WshSHell.popup "复制‘记事本’到桌面-(复制文件)。",5,"这是个结束进程删除文件的实例-QQ25926183",0+64
WshSHell.Run (chr(34)&Target&chr(34))
WScript.Sleep 1000
WshSHell.popup "运行‘记事本’在桌面-(创建进程)。",5,"这是个结束进程删除文件的实例-QQ25926183",0+64
for each ps in getobject _
("winmgmts:\\.\root\cimv2:win32_process").instances_
if LCase(ps.name)="notepad.exe" then
WshSHell.Run ("ntsd -c q -p "&ps.handle), vbHide
WshSHell.popup "关闭‘记事本’在任务-(结束进程)。",5,"这是个结束进程删除文件的实例-QQ25926183",0+64
WScript.Sleep 1000
FSO.DeleteFile ps.executablepath
WshSHell.popup "删除‘记事本’从桌面-(删除文件)。",5,"这是个结束进程删除文件的实例-QQ25926183",0+64
end if
next
Set WshSHell = Nothing
Set FSO = Nothing
WScript.Quit(0)

你可能感兴趣的:(C++,c,C#)