How to pass a variable in Dos Command using QTP?
Eg:
Dim path1, path2
path1 = "C:\Test\sample1.doc"
path2 = "C:\Test\sample2.doc"

How can we pass these path1 and path2 inside the "copy" dos
command?
I tried like this. this is not working.

oShell.run "cmd /K copy" &path1 &path2

Answer Posted / raghuram

Dim oShell
Set oShell = CreateObject ("WSCript.shell")
oShell.run "cmd /K CD C: & Dir"
Set oShell = Nothing

I was able to do in this way....you can try and let me know

Is This Answer Correct ?    3 Yes 6 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is a quick test professional?

643


what QTP Options do you know?

2933


How to analyzing test results using quicktest professional (qtp)?

594


What are advantages of test automation?

677


I want to read XML file loaded in Quality center and compare the values with the values displayed in Application (web table).How can I do that

1404






how to convert 100 into hundred repees only and viceversa

1457


What is parameter in qtp?

686


Can any give an example(if possible templates) how to test web application using QTP. thanks in advance

1569


What is synchronization? What are the ways you can synchronize?

659


What is the extension of qtp local repository?

582


Is it possible to merge two object repository files in qtp?

630


hou can we use vb script in qtp could u tell me breafly

1747


How can i get the image text that changes dynamically? Here i have used "GetROProperty", but it's not working. I used like Ex:Browser("webmail").Page("inbox").image ("captchaimage).getroproperty("innertext/text/value")

1429


Does QTP have any limitations?Can it work with all kinds of programming languages like java,springs,ajax ,hybernet?Also does it work well with windows 7.What are its other limitations

1779


How to call a test from another test?

692