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






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

Answer / 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 ?    2 Yes 5 No

Post New Answer




More QTP Interview Questions

list me out the shortcutkeys for some functionlities in the qtp for example to record ,to run ... etc

2 Answers   CTS,


How to find operating system information using the qtp script?

0 Answers  


How do you open adobe acrobat file in QTP and do some testing on that file ?

0 Answers  


what is the diff b/w assistive and mandatary rules of object repository in QTP???

0 Answers  


Is there any option in QTP to add Java add-in after instaling the QTP?

3 Answers   IBM,






What is the use of virtual objects?

1 Answers  


What is the descriptive programming?

0 Answers  


In QTP if u got a defect , how to report to developer using Test director or Quality center .

5 Answers   Wipro,


How to invoke QTP through VBscript?Send me full code along with description of the code.Thanks in Advance

1 Answers   Capco,


If our application contain one image while executing script application failed to show that image but you have to check that image by importing dynamically from other location... Can we use Check Points here on dynamically imported image?

2 Answers   ADP,


I want to install qtp software in my system, My operating system is vista . Anybody please suggest me how to get QTP software with licence key

2 Answers  


assume i have few url link how will i dynamically call then using descriptive programming?

0 Answers   BirlaSoft,






Categories