Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

NET SEND output of FIND command

Status
Not open for further replies.

AlexChao

Technical User
May 16, 2003
44
SG

I like to NET SEND the output of the FIND command. How to script this using JavaScript or Windows NT Shell script ?
 
Hi, this puts the output from a find in to a string, it might get you started:

Code:
msgbox getoutput("C:\WINDOWS\SYSTEM32\find.exe /i /n ""Use Path:"" c:\winzip.log")

function getoutput(app)

	Dim WshShell, oExec
	Set WshShell = CreateObject("WScript.Shell")
	'The "app" is launched
	Set oExec = WshShell.Exec(app)

	'wait for the end of the process
	Do While oExec.Status = 0
	Loop

	'the command output flow goes to a string variable
	Do While oExec.StdOut.AtEndOfStream <> True 
		str = str & trim(oExec.StdOut.ReadLine) & vbcr
	Loop
	getoutput = str
end function

Hope I could be of assistance
Regards
Thomas
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top