How to execute batch file from command prompt using QTP - Printable Version +- Micro Focus QTP (UFT) Forums (https://www.learnqtp.com/forums) +-- Forum: Micro Focus UFT (earlier known as QTP) (https://www.learnqtp.com/forums/Forum-Micro-Focus-UFT-earlier-known-as-QTP) +--- Forum: UFT / QTP Others (https://www.learnqtp.com/forums/Forum-UFT-QTP-Others) +--- Thread: How to execute batch file from command prompt using QTP (/Thread-How-to-execute-batch-file-from-command-prompt-using-QTP) |
How to execute batch file from command prompt using QTP - sachindhote - 05-29-2009 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. RE: How to execute batch file from command prompt using QTP - supputuri - 07-09-2009 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. RE: How to execute batch file from command prompt using QTP - sneha2409 - 08-13-2012 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 |