Solved

How to run scripts in vb.net

Posted on 2004-04-27
3
343 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Article by: jpaulino
XML Literals are a great way to handle XML files and the community doesn’t use it as much as it should.  An XML Literal is like a String (http://msdn.microsoft.com/en-us/library/system.string.aspx) Literal, only instead of starting and ending with w…
Parsing a CSV file is a task that we are confronted with regularly, and although there are a vast number of means to do this, as a newbie, the field can be confusing and the tools can seem complex. A simple solution to parsing a customized CSV fi…
Finding and deleting duplicate (picture) files can be a time consuming task. My wife and I, our three kids and their families all share one dilemma: Managing our pictures. Between desktops, laptops, phones, tablets, and cameras; over the last decade…

726 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