Link to home
Start Free TrialLog in
Avatar of baudspeed
baudspeed

asked on

How to run scripts in vb.net

I am currently trying to figure out a way of creating an application which can, when provided with a script (in any langauge) execute it and aquire data from the script.

Basicly, my ideal solution would be to have a vb.net application run a script (javascript, vb script, php, any one type) internally to generate a result. ie check to see what applications  are running, etc

can vb.net do this? i am a vb6 programmer and have done some vb.net. Has anyone done this or can provide a link for more info?
ASKER CERTIFIED SOLUTION
Avatar of gregoryyoung
gregoryyoung
Flag of Canada image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of chaniewskim
chaniewskim

Try this

Imports System.Diagnostics

[...]

' Create a new Process
Dim procInfo As New ProcessStartInfo("c:\myprogram.exe", "any params")
' Set some properties on the ProcessStartInfo
procInfo.UseShellExecute = False
procInfo.CreateNoWindow = True
procInfo.RedirectStandardOutput = True

' Run the program
Dim theProgramProcess As Process = Process.Start(procInfo)

' and capture the output
Dim outputData As String = theProgramProcess.StandardOutput.ReadToEnd()
Avatar of baudspeed

ASKER

chanieswkim
Thats reallly really not how i want to do it. I dont want to execute binary code, and i want to keep track of the process as it runs withough having it in another memory space. Its really important to understand that i need to run a scripting language (any kind) dynamically. Meaning that at the last moment when the application preps to run, the code can be changed by the application. if the solution provided was to be run, nothing could ever be changed prior to the run.

Thanks though

GregoryYoung,
I think i might pass on the points to you, i need a bit more understanding so if you have any more good links i would be very much appreciative.
From what i can see, it does is allow what i am looking for, although the code needs to be compiled  it can be done programatically on during run time, which is fine.

http://www.codeproject.com/vb/net/DotNetCompilerArticle.asp is another good link btw.