I want to write text into a dos mode say, wanna write dir in the command prompt. I could open the dos window using vb scripting. Is there a way to write into it ?
Can anyone help me in this matter?
Have a lok at the SendKeys method.
</font><blockquote><font size="1" face="Verdana, Arial, Helvetica">code:</font><hr /><pre style="font-size:x-small; font-family: monospace;">Dim WSHShell, return
Set WSHShell = WScript.CreateObject("WScript.Shell"
WSHShell.SendKeys "Hello from VBScript"</pre><hr /></blockquote><font size="2" face="Verdana, Arial, Helvetica">
Hope this helps.
I tried to run this in "wscript " in dos mode...
It is giving error "Object Doesnt Support this propery or method"... Can I do something for this.
You can find the detailed answer of your question in QTP Help. I just copy the code here.
Set oShell = CreateObject ("WSCript.shell")
oShell.run "cmd /K CD C:\ & Dir"
Set oShell = Nothing