Jump to content

Running Visual Basic Scripts (*.vbs) from LabVIEW


Recommended Posts

Posted

I am trying to run a simple Visual Basic Script from LabVIEW. I can successfully run the script from the Windows Command Prompt and by double-clicking on the *.vbs file.

I tried running it using 'System Exec.vi', but I get an error everytime. I've tried many combinations of 'command line' and 'working directory' control inputs, but nothing has worked.

Is the 'System Exec.vi' the right tool for the job? Does anyone have any suggestions?

Thanks,

Allan

Posted

I found one method using System Exec.vi that works.

If I use the command line "cmd /C "VisualBasicScriptFile.vbs"" and set the working directory to the folder containing the .vbs file, it works. This is a simple enough solution, but I would like to hear other ideas about this.

Thanks,

Allan

Posted

You can also use the command line wscript.exe "file path" to execute the script.

Or use Windows Script Control ActiveX interface to load/run scripts strings in memory.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.