Click here to Skip to main content
15,885,914 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I am not able to run .vbs file from c++ program. plz help me to solve the problem.

What I have tried:

I am not able to run .vbs file from c++ program. plz help me to solve the problem.
Posted
Updated 26-Jun-20 4:48am
Comments
CHill60 21-Mar-16 9:44am    
What have you actually tried?

try using
C++
system("filename.vbs");
 
Share this answer
 
Comments
CHill60 26-Jun-20 12:29pm    
As suggested in Solution 1 four years ago
you can host a vbs script engine inside C++, using COM and Windows Script Engines[^]

It's not particularly difficult, if you have a good grasp of COM
 
Share this answer
 
To run a VBS script see Microsoft Windows 2000 Scripting Guide - Running Scripts from the Command Line[^].

To execute a command from a C/C++ application use system, _wsystem[^], _popen, _wpopen[^] or the ShellExecute function (Windows)[^].

To get the data printed out by the script, redirect the output to a text file (see first link) and read that file afterwards or use _popen() (see example at the _popen MSDN link).
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900