Solved

How to run scripts in vb.net

Posted on 2004-04-27
3
341 Views
Last Modified: 2010-04-24
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?
0
Comment
Question by:baudspeed
3 Comments
 
LVL 37

Accepted Solution

by:
gregoryyoung earned 500 total points
ID: 10935442
take a look at the reflections area of the framework

http://www.devx.com/dotnet/Article/7004/1954?pf=true this is how to generate and execute (just executing is easier)
0
 
LVL 5

Expert Comment

by:chaniewskim
ID: 10936187
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()
0
 

Author Comment

by:baudspeed
ID: 10939399
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.
0

Featured Post

ScreenConnect 6.0 Free Trial

At ScreenConnect, partner feedback doesn't fall on deaf ears. We collected partner suggestions off of their virtual wish list and transformed them into one game-changing release: ScreenConnect 6.0. Explore all of the extras and enhancements for yourself!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Microsoft Reports are based on a report definition, which is an XML file that describes data and layout for the report, with a different extension. You can create a client-side report definition language (*.rdlc) file with Visual Studio, and build g…
Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
Along with being a a promotional video for my three-day Annielytics Dashboard Seminor, this Micro Tutorial is an intro to Google Analytics API data.
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…

778 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question