Click here to Skip to main content
15,886,732 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Is it possible to call a VBscript from within a Win32 executable
Posted
Comments
Steven J Jowett 9-May-11 6:39am    
Yes it is possible. You would need to tell us what you trying to do and what language your problem is written in. Also be aware that x64 Windows operating systems do not support the embedding of VBScript into programs.
Sandeep Mewara 9-May-11 6:57am    
5!
Member 7873102 9-May-11 8:28am    
I created a VBScript to move some of the files into a particular folder . I am trying to create a Win32 exe using C++ , so that whenever the user runs the exe , it will automatically call the script .
How do we call the VBScript within the exe .

If your goal is moving around some files, writing some pure C++ code will be much easier. Even if your goal is making the code easy to configure, you can use some plug-in techniques. Well, you want to allow your user to modify the code of moving files and similar stuff, yes using some scripting may make some sense.

You need to invoke and use Windows Scripting Host (WSH). Please see http://en.wikipedia.org/wiki/Windows_Script_Host[^] and the references to MSDN with API and full documentation.

—SA
 
Share this answer
 
Comments
Espen Harlinn 9-May-11 15:47pm    
Good answer, my 5 :)
Sergey Alexandrovich Kryukov 9-May-11 20:36pm    
Thank you, Espen.
--SA
You could execute your VBS source file using a system call

Example:

system("myfile.vbs");
 
Share this answer
 

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