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 ?    3 Yes 6 No

Post New Answer

More QTP Interview Questions

hi,i have a pblm in qtp,im testing an webappl in which different types of error pop up messages are displayed which qtp is not differentiating or it is not recognising. how do i make it recognise different popup errorm messages while writing script?

4 Answers  


in how many ways you perform batchtesting?

2 Answers   Sapient,


What is XML checkpoint in QTP. How we can use in Web Based application

2 Answers   LinkEdge,


where is the bitmap checkpoint be saved

3 Answers  


how do we add a new sheet to data table in QTP?

7 Answers   TCS, Wipro,


Hi. please provide license key for QTP 9.2, I have windows XP on my machine Thanks in Advance, moreshwar

0 Answers  


Hi, How to give drop down values as input [Variable] from data table in QTP? If u know share with me.

3 Answers  


What are the enhancements u did after recording ur script?

3 Answers  


hi guys this is Keerthi, I am searching for job,so I want to know which questions are intervier asking on QTP&MANUAL&QUALITY CENTER,can u send Any one questions&Answers to my id:chinna.ammi@yahoo.co.in

8 Answers  


what is On Error Resume Next ?

1 Answers   Accenture,


How can I test the unix shell in QTP

2 Answers   Persistent,


How to handle the errors without using recovery scenery?

3 Answers  


Categories