[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 357
  • Last Modified:

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?
0
baudspeed
Asked:
baudspeed
1 Solution
 
gregoryyoungCommented:
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
 
chaniewskimCommented:
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
 
baudspeedAuthor Commented:
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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now