LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Run VB Script from CVI program

How can I run Visual Basic Script (*.vbs) from the CVI program
0 Kudos
Message 1 of 2
(3,495 Views)
If you have the CVI Full Development System, you can use the ShellExecute SDK function to run a VB Script. Installing SDK is an option with the CVI FUll Development System. You can reinstall CVI to add SDK if you skipped it the first time.

From the project window, go to Edit > Add Files to Project >> Library (*.Lib) and browse to ...\CVI\SDK\lib\Shell32.lib.
Add these two includes to the top of your list in the .c file.
Note: delete the space after < (I added the space to fool the forum's HTML error detection).
#include < windows.h>
#include < shellapi.h>
//....
// to run a VB Script:
ShellExecute( NULL, NULL, "c:\\mypath\\myscript.vbs", NULL, NULL, 0);
Message 2 of 2
(3,486 Views)