Welcome guest. Before posting on our computer help forum, you must register. Click here it's easy and free.
Computer Hope forum e-mail issues and down time
0 Members and 1 Guest are viewing this topic.
Set objFSO = CreateObject("Scripting.FileSystemObject")strMyFile = "c:\test\new.txt"i=0Set objFS = objFSO.GetFile(strMyFile)If objFS.Size = 0 Then WScript.Echo "0 size file: " & objFSO.GetFile(strMyFile).NameElse Set objFS = objFSO.OpenTextFile(strMyFile) Do Until objFS.AtEndOfLine objFS.ReadLine i=i+1 Loop WScript.Echo i If i < 5 Then WScript.Echo "File: " & strMyfile & " has less than 5 records " End If End If
c:\test> cscript /nologo script.vbs