Micro Focus QTP (UFT) Forums

Full Version: How to read text in command prompt using QTP
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi,

I am trying to perform some operations using command prompt. I am able to write something on command prompt but unable to fetch the output text from the command prompt. I had tried with GetVisibleText property for a window but its giving just the title of that window instead to the body.
Please suggest any alternative to fetch text from window(Command Prompt).

Thanks.
you may try this approach
Code:
Set screen = CreateObject("WScript.Shell").Exec("%COMSPEC% /c date /t")
Do While screen.Status = 0
  WScript.Sleep 100
Loop
WScript.Echo screen.StdOut.ReadAll