running vbscript from VB.NET

  • Thread starter Thread starter DraguVaso
  • Start date Start date
D

DraguVaso

Hi,

I want to run some vbscripts from a VB.NET application. Anybody knows how to
do this?

Thanks,

Pieter
 
Hi Pieter,

This is the only one I could find direct,

It uses the webbrowser

It was the first piece of code I got from Herfried and I find it still
greath.

(Do not think there was much after that)

:-))

\\\
AxWebBrowser.Navigate("about:<html><body
onload=javascript:window.external.addFavorite('" + textbox1.Text +
"')></body></html>")
///


Cor
 
* "DraguVaso said:
I want to run some vbscripts from a VB.NET application. Anybody knows how to
do this?

\\\
System.Diagnostics.Process.Start("C:\foo.vbs")
///
 
You need to host the VBScript within something; the simplest thing to do is
to put a reference the Microsoft Script Control into your windowform, then
run the script within the control.
 
You have 2 options:

1. Run vbscript as standalone process - VB.Net has Shell() function. Execute

cscript.exe "C:\Path\FileName.vbs"

2. Host vbscript inside your application - the easest way is to use
Microsoft Script Control.

As another option you may let users write VB.Net code. In your application
you will need to compile and run it.

//------------------------------------
Regards,
Vassiliev V. V.
http://www-sharp.com -
Scripting/HTA/.Net Framework IDE
 
Back
Top