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

How can I check if a environment variable exist or not?

0 Answers  


can any body help me out by providing links/material for descriptive programming in QTP otherwise can you post decriptive programing based interview Questetion&ans. plz help me out . i need it.

1 Answers   ADP,


What will be the test script in QTP to test a ComboBox where a user has to select more than two items????

8 Answers   L&T,


What is difference between Quality centre and Test Director?

1 Answers   Nokia,


Please explain the role of Regular expression in QTP

0 Answers  






Can we test internet application using QTP?

2 Answers   Quinnox,


I recorded a Web App with a Oracle backend using QTP 9.5 and for some reason the scripts don't play back> What am I missing at this point. I recorded the same Apps under Sybase and they work great. This is Oracle 10g. Why won't my scripts play back.

0 Answers  


we have 10 more actions in our test and we are using exit action command to come out from the action if any error s occured.In action 1 if any error occurs control is moving to second action but if we get error in second action exitaction is throwing general run error. Please give a idea to overcome .

1 Answers   TCS,


In Manual testing , can u prpare bug report in TD?

1 Answers   TCS,


anyone can explian about types of "Triggere Events" in QTP

1 Answers  


Without QTP (or any Testing tool) can we able to test the GUI part of the Applications. for Example generating the Scripts in Notepad and Executing them Using VB. Is it Possible to do so.. Correct me if iam wrong some where.

8 Answers   Microsoft,


Write the script to delete the mail which is at 9th,13th and 18th place in INBOX of Gmail ?

3 Answers  


Categories