Posts: 1
Threads: 1
Joined: Apr 2009
Reputation:
0
05-29-2009, 05:16 PM
In my project I have to run some bathc files in command prompt.
Afte executing this batch file it creates some tabnles and data in database.
I want to automate this process using the QTP.
Please help me if any one knows the code aur way how to procedd for this.
Posts: 516
Threads: 17
Joined: Jul 2009
Reputation:
3
07-09-2009, 06:29 PM
Hi Sachin,
we have to use Shell object to work with command prompt.
Let's see simple example here:
Set WSH = CreateObject("wscript.shell")
WSH.run "cmd /k CD C:\ & Dir"
if you want to see the command prompt you have to specify (/k) otherwise (/c) which will close the command prompt atomatically once the command is executed. Please specify the path of your batch file in the above code and then execute the script.
Let me know if you need any more info.
Thanks,
QTPKing.
Posts: 1
Threads: 0
Joined: Aug 2012
Reputation:
0
08-13-2012, 04:47 PM
Hi,
I tried using the code mentioned by you
i replaced Dir with ""N:\sneha\UpdatedUtility\runUtility.bat"...The error i get is "invalid directory name"
m unable to find a ETA
plz help
Thanks,
sneha