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

How to remove associated function library?

566


How to check bitmap output value?

629


Can any suggest me what is exposure testing?

1382


diff between qtp versions from 8.5

1571


what is error and fault in terms of software quality?

1509






How do you know the location Id of an object if you know its index id?

591


Is it possible to split an action? How?

662


Sql questions to find second max salary and how to use joins

967


wt is the use of multiple questions in QTP

1680


How will you handle java tree in qtp?

629


How would you directly trigger javascript in a test?

1473


How to find the length of the string in qtp?

582


what is the difference between built-i function and In-built function?

1637


Hi All, How to Compare two strings character by character in QTP

955


Describe the differences between functions and actions in UFT?

612