run script from

I Have a prog which contains a flie "vbscript1.vbs" simply i need to click a button and for the script to run
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.


System.Diagnostics.Process.Start ("c:\PathtoScript\vbscript1.vbs")
Dim obj as new Process

You can use obj.WaitForExit() method to wait till the process has
TREERAuthor Commented:
unfortunately, your ideas do not work although they nearly do
the following error occurs when i attempt your code

char 1
error Object expected
code 800A138F
Source Microsoft jscript runtime error

so i replaced my javascript code  with a simple

but still the same error occurs

 i have increased the points to 500, many thanks for your time

Microsoft Azure 2017

Azure has a changed a lot since it was originally introduce by adding new services and features. Do you know everything you need to about Azure? This course will teach you about the Azure App Service, monitoring and application insights, DevOps, and Team Services.

This indicates that it 'is' working - but reporting back an error in the called script..
Here is an "in process" way to run a vbscript using a COM-based DLL

        ' Include a COM reference to "Microsoft Script Control" (MSScriptControl)
        Dim host As New MSScriptControl.ScriptControlClass

        host.Language = "VBScript"
        host.AddCode("Sub main" & vbCr & "Msgbox(""Hello"")" & vbCr & "End Sub")

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
TREERAuthor Commented:
sirbounty ,

i can see your logic, and indeed that was my first thought, that is why i replaced my original script with just the one line


the result was the same error

graye, the script is javascript, will this be the same?
I don't know much about javascript, but that's a vb script you're trying to run and alert("try") is not a valid command...

wscript.echo "Hello"

You can run VB.Net Shell() function to execute the script as simple as possible:
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual Basic.NET

From novice to tech pro — start learning today.