Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to execute batch file from command prompt using QTP
#1
Not Solved
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.
Reply
#2
Not Solved
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.
Reply
#3
Not Solved
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
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Is it possible to execute Remote Agent witout ALM? CharlieMadrid 0 1,205 05-12-2020, 01:26 PM
Last Post: CharlieMadrid
  How to execute a UFT script when computer is in locked state akilamurugesh 4 13,031 08-25-2014, 07:41 PM
Last Post: akilamurugesh
  Need to execute the QTP Script where QTP is not installed. prasannadr 0 2,383 06-20-2014, 07:15 PM
Last Post: prasannadr
  PDF to text converter needed. (command line version freeware) priyaang 2 2,855 03-27-2014, 03:48 PM
Last Post: priyaang
Exclamation QTP 11.0 crash on batch execution from QC 11.0 after patch 15 installed on QC server akothuru 0 2,170 02-13-2014, 03:27 PM
Last Post: akothuru

Forum Jump:


Users browsing this thread: 1 Guest(s)