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

what is regular expression how will you implement it?

1 Answers  


Could you please any one give code for the following ? Scenario : Suppose a excel file contains 10 records and earch have 5 fields. how can i input this excel file for datadrive wizard ? Please explain

0 Answers  


How cookies can be tested in QTP?

2 Answers   Deloitte, TCS,


Without using gui map editor we can recognize the application in winrunner ?

0 Answers  


Explain the N-tire structure(process) for Funds Transfer ( means give N ways to funds Transfer in an Application)

0 Answers   GXS,






HI. Plz Clarifie my doubt,having 2+yrs experience in Testing , But My accedamics(Xth,INTER) are Less than 60%, But B.Tech 72%. It creats any problem , When i change to any MNC. plz tell me......... lot of friends told it's a problem, Some people says NO problem, What .............

3 Answers  


Waht is Test Report , What it consists?

2 Answers  


h u call the function

6 Answers   Wipro,


I need diffrences between Object Identification, Smart Identification, Regular expresion,Low-Level Recording (enables you to record on any object in your application, whether or not QuickTest recognizes the specific object or the specific operation.) I am working on Web Application. In that object caption will change dynamically. For example, consider “Save” button. On clicking save button the caption changing as “ EDIT ”. From above concept which concept I have to use here?

2 Answers   Ordain Solutions,


How to modify the text checkpoint?

0 Answers  


what type of automation is follwed in the project?

0 Answers   Google,


write vbscript on veb applications in qtp with exapmles?

1 Answers  


Categories