Solved

How to run scripts in vb.net

Posted on 2004-04-27
3
332 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
Comment Utility
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
Comment Utility
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
Comment Utility
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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

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…
Creating an analog clock UserControl seems fairly straight forward.  It is, after all, essentially just a circle with several lines in it!  Two common approaches for rendering an analog clock typically involve either manually calculating points with…
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

728 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

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now