我有一个简单的VBScript,它使用循环将stdOutput写入文本文件。
该脚本有效,但我的问题是每次循环运行时屏幕上都会出现一个闪烁的窗口。我希望阻止那个闪烁的窗口出现。
我通过windows cmd.exe
运行vbscript。
Set sh = CreateObject("Wscript.Shell")
Set objFSO = CreateObject("Scripting.FileSystemObject")
Dim counter, myNum, fileLine, outFile, objFile
myNum = 0
counter = 90
outFile = "netband_logger_vbs.tmp"
Set objFile = objFSO.CreateTextFile(outFile, True)
Do While myNum < counter
myNum = myNum + 1
Call GetConnections()
Loop
Function GetConnections()
i = 0
Set shExec = sh.Exec("netstat -e")
Do While Not shExec.StdOut.AtEndOfStream
fileLine = shExec.StdOut.ReadLine()
objFile.Write fileLine & vbCrLf
Loop
objFile.Close
End Function