代码如下:
Dim WS'Dim variable.
Set WS=WScript.CreateObject("WScript.Shell")
'Create object.
WS.Run "",1
'上面一行双引号中键入文件路径.逗号后面的"1"意思为正常运行此程序,改为0可隐知早孝藏运行.
WS.Run "taskkill /f /im notepad.exe",0
'以上是一个关闭记睁蔽事本的代码示例.将"notepad.exe"搭稿改成你想要结束的进程可关闭相应的程序.
path ="D:\" '程序路径"皮衫橘exeName="qq.exe" '程序名称
Set s = WScript.CreateObject("Wscript.Shell")
Set fso = WScript.CreateObject("Scripting.Filesystemobject")
Set fs=fso.GetFolder(path)
s.Run path &exeName
For Each file In fs.Files
If right(file.Name,3)="燃团log" Then
s.Popup "文件" &vbCr &file.Name,1,""塌岩
read (Path &file.Name)
End if
Next
sub read(file)
Set f = fso.OpenTextFile(file, 1 ,True)
Do
str=f.Read (1)
If str= "X" Then MsgBox " 有 X " :Exit Sub
Loop Until f.AtEndOfStream
MsgBox "没有 X "
End sub
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)