Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

vbs equivalent of FINDSTR

1,012 views
Skip to first unread message

Raymond

unread,
Oct 1, 2001, 5:36:21 PM10/1/01
to
Someone has an idea of what could be the vbScript equivalent of FINDSTR ?,
except running it within a vbScript (which is what I'm doing now)

FINDSTR is quite powerfull and very fast, so a vb equivalent would be nice.

Thanks
Raymond


Steve Fulton

unread,
Oct 2, 2001, 7:59:53 AM10/2/01
to
A clue about what you're trying to accomplish would help.

You can invoke findstr from a VBScript:

Set WshShell = CreateObject("WScript.Shell")
WshShell.Run "%comspec% /c findstr ... > temp.txt", 0, True

Then you can use the FSO to read temp.txt for the results.

Other than that you're going to have to read the file(s) in question and use
InStr or a regular expression to find the string(s) you're looking for.

Windows Script Documentation
http://download.microsoft.com/download/winscript56/Install/5.6/W982KMeXP/EN-US/scrdoc56en.exe

--
The teacher is like the candle which lights others in consuming itself.
-Giovanni Ruffini

=-=-=
Steve
-=-=-

"Raymond" <squar...@round.hole> wrote in message
news:3bb8e1d5$0$21071$ba62...@news.skynet.be...

Raymond

unread,
Oct 2, 2001, 3:05:36 PM10/2/01
to
I'm preparing for a migration, where the server name will change. To be a
bit pro-active, I'm trying to find references to the "old" servers (UNCs
like \\SERVER\xxx) in all instances of MS-Office documents (txt, doc, xls,
ppt, mdb)
So far I'm using the syntax you mention but I was wondering if there were a
better way, ie more vbScript like.
I thought, if FINDSTR can do it so fast, there must be some API, so maybe
there is a vbScript equivalent

Thanks for the reply
Raymond

"Steve Fulton" <cerbe...@hotmail.com> wrote in message
news:ONvByozSBHA.1960@tkmsftngp03...

0 new messages