R
R
Rinat Norezov2019-05-23 01:16:39
cmd/bat
Rinat Norezov, 2019-05-23 01:16:39

VBS. How to determine the number of lines in a file and display dynamically?

Good day. There is a text file list.txt in which the contents are constantly changing, about once a second. It is necessary to display the number of lines in the information window, also with an interval of a second. When you click on the "OK" button, exit. I am not strong in scripts, I found a similar example:

The code
Dim fso, ts
Set fso = CreateObject("Scripting.FileSystemObject")
Set ts = fso.OpenTextFile("c:\test.txt")
s = ts.Readall
ts.close
x =ubound(Split (s,vbCrlf))+1
WScript.Echo "Количество строк: " & ubound(Split (s,vbCrlf))+1

www.cyberforum.ru/vbscript-wsh/thread1491347.html
Only he considers one-time, but it would be necessary all the time. From Google I realized that I need to stick somewhere
Do
loop

But I don't know where to put it. How would this be done on VBS or WSH?
Thanks in advance.

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question