Click here to Skip to main content
11,928,605 members (56,085 online)
Rate this:
Please Sign up or sign in to vote.
See more: VBScript Win32
Is it possible to call a VBscript from within a Win32 executable
Posted 9-May-11 1:09am
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.
S Mewara 9-May-11 6:57am
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 .
Rate this: bad
Please Sign up or sign in to vote.

Solution 1

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[^] and the references to MSDN with API and full documentation.

Espen Harlinn 9-May-11 15:47pm
Good answer, my 5 :)
SAKryukov 9-May-11 20:36pm
Thank you, Espen.
Rate this: bad
Please Sign up or sign in to vote.

Solution 2

You could execute your VBS source file using a system call



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

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy | Mobile
Web01 | 2.8.151126.1 | Last Updated 9 May 2011
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100