How to capture Dos Promote data in text file? in that how to
find particular String ( window )? in VB scrpting



How to capture Dos Promote data in text file? in that how to find particular String ( window )? in..

Answer / Pranav Prakash

Capturing DOS Prompt data and finding a specific string can be done using VBScript. Here's an example:

First, create a batch script to capture the output and redirect it to a text file:

```bat
cmd.exe /c your_command > output.txt
```

Next, use VBScript to read the contents of the text file and find a specific string:

```vbscript
Dim objFSO, objFile, strLine, intLineNumber
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objFile = objFSO.OpenTextFile("output.txt", 1) ' Open the file for reading
intLineNumber = 0
Do Until objFile.AtEndOfStream
strLine = objFile.ReadLine
intLineNumber = intLineNumber + 1
If InStr(strLine, "your_string") > 0 Then ' Find a specific string
WScript.Echo "Line number: " & intLineNumber & " - String found: " & strLine
End If
Loop
objFile.Close
```

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Automation Testing AllOther Interview Questions

Explain me what is a framework and what are the frameworks available in rc?

1 Answers  


When do you prefer manual testing over automation testing?

1 Answers  


What are some of the common misconceptions during implementation of automated testing tools for the first time?

1 Answers  


Is ui level testing possible?

1 Answers  


Hi every body.. Whn i install QC 9.2 in window xp sp2 it ll show the error msg as it will nt support. How can i install in this OS.. Plz plz help me and i installed IIS and oracle 8i.. Plz Plz help me for this one

1 Answers  


what we have done after display the result in openSTA result pane.in the sense that how we send the report,what we send in report,how to know that where is error.quickly tell me the answer...please

1 Answers  


Tell us the difference between assert and verify commands?

1 Answers  


WHAT WE CAN NOT DO WITH QTP? GIVE 5 POINTS.(EXCEPT PERFOMANCE)

0 Answers  


I heard that there is a test management system that makes tracking metrics an easy task. I would like to know more about it. Please guide me.

1 Answers  


what is the command for identifing the color of the object. please help me ? my numberis 9916800532

3 Answers   TCS,


How could you explain the main difference between webdriver and rc?

1 Answers  


What are the main attributes of test automation?

2 Answers  


Categories