Sign in to follow this  
Followers 0
joeloyzaga

running an autoit script via vbs

2 posts in this topic

is it possible to run an autoit script from vbs? and can autoit send values back as strings or do I need to use environment variables?

thanks joe

Share this post


Link to post
Share on other sites



It can. You can run it using the WScript object, and copy the rest off the internet (thats what I did...)

Dim WSHShell
Set WSHShell = WScript.CreateObject("WScript.Shell")

Set objExec=WSHShell.Run "Autoit3.exe /AutoIt3ExecuteScript MyScript.au3", 1, false

Do While Not objExec.StdOut.AtEndOfStream
strCmdOutText=objExec.StdOut.ReadLine()
If InStr(strCmdOutText, "Error") then
bolError = true
Wscript.Echo Date & " " & Time & " Error Running exe"
End If
Loop

Set WSHShell = Nothing
WScript.Quit(0)

I have never coded in vbs in my life. Neither have I tested the code.

Mat

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0