Micro Focus QTP (UFT) Forums
cmd.exe recognization - Printable Version

+- Micro Focus QTP (UFT) Forums (https://www.learnqtp.com/forums)
+-- Forum: Micro Focus UFT (earlier known as QTP) (https://www.learnqtp.com/forums/Forum-Micro-Focus-UFT-earlier-known-as-QTP)
+--- Forum: UFT / QTP Beginners (https://www.learnqtp.com/forums/Forum-UFT-QTP-Beginners)
+--- Thread: cmd.exe recognization (/Thread-cmd-exe-recognization)



cmd.exe recognization - ramesh.tahiliani - 09-09-2009

hi
i am trying to put some text on command Propmpt but the code is not coming when i am using the Record metod. do i require to make some settings

however i tried descriptive programming to activate the cmd window using Window("text:=C:\WINDOWS\system32\cmd.exe").Activate then its not identifying it while playback (Verify that this object's properties match an object currently displayed in your application.)

i have used ActiveX and VB AddIns

can somebdy help on this

thanks
Ramesh


RE: cmd.exe recognization - Saket - 09-09-2009

I dont think, we can record the command window as this is a DOS window.
You can work on this using "wscript.shell"

Code:
set oCmd=createobject("WSCript.Shell")
oCmd.run "cmd /K Date"

There can be some other ways as well to handle this , depends on the requirement.


RE: cmd.exe recognization - ramesh.tahiliani - 09-09-2009

thanks
it worked

Code:
Set a = CreateObject("WScript.shell")
a.Run "cmd"
a.SendKeys "hello{ENTER}"