
CODE: [Copy to clipboard]On Error Resume Next
Set oFSO = CreateObject("Scripting.FileSystemObject")
Set oFile = oFSO.OpenTextFile("a.txt")
If Err Then
WScript.Echo Err.Description
Set oFSO = Nothing
WScript.Quit
End If
Do Until oFile.AtEndOfLine
str = oFile.ReadLine
Loop
WScript.Echo str
oFile.Close
Set oFile = Nothing
Set oFSO = Nothing
CODE: [Copy to clipboard][ Last edited by lotus516 on 2008-2-10 at 06:01 PM ]Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objFile = objFSO.OpenTextFile("C:\Scripts\Test.txt", 1)
Do Until objFile.AtEndOfStream
strNextLine = objFile.ReadLine
If Len(strNextLine) > 0 Then
strLine = strNextLine
End If
Loop
objFile.Close
Wscript.Echo strLine
| 欢迎光临 中国DOS联盟论坛 (http://cndos.fam.cx/forum/) | Powered by Discuz! 2.5 |