Click here to Skip to main content
11,711,750 members (69,560 online)
Rate this: bad
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 0:09am
Steven J Jowett at 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 at 9-May-11 6:57am
Member 7873102 at 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 at 9-May-11 15:47pm
Good answer, my 5 :)
SAKryukov at 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
0 CHill60 280
1 Sergey Alexandrovich Kryukov 264
2 Andy Lanng 160
3 OriginalGriff 130
4 Richard MacCutchan 130
0 CHill60 280
1 Sergey Alexandrovich Kryukov 125
2 Andy Lanng 120
3 Abhinav S 95
4 Maciej Los 95

Advertise | Privacy | Mobile
Web04 | 2.8.150819.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