aku1 发表于 2006-6-2 8:45:15 |
这是WSH的一个脚本,其实WSH简单来说他是提供Script运行的一个平台,他并不是脚本语言:
Set objShell=Createobject("WScript.exe")
Set objWshscriptExc = objShell.Exec("ipconfig /all")
Set objStdOut=objWshScriptExe.StdOut
' ' Skip first four lines (注意注释是单引号) '
for i=1 to 4
strLine=objStdout.ReadLine
WScript.Echo strline
Next
' ' Add date/time information '
strCurrentTime = " Current Date/Time .................."& Now()
WScript.Echo strCurrentTime
' ' Display the rest of the output '
While Not objStdout.AtEndofstream
strline=objStdout.ReadLine
WScript.Echo strline
Wend
http://www.microsoft.com/china/technet/archives/columns/scripts/sg1002.asp
|