『第
2 楼』:
导入文本多此一举,如确实需要导入,自行修改。。。。
结束进程删除文件实例
看效果请放在桌面执行。
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) [ Last edited by baomaboy on 2007-4-4 at 03:23 AM ]
|