Jump to content

Calling an autoit exe from VB 6

Recommended Posts

Hey, I am using a VB front end to call an autoit exe file. However if VB is running auto it exe files will not execute.

PlatformApp = Shell("c:\platformup.exe", 1)   ' Start Application
       AppActivate PlatformApp

I see the Autoit icon pop up but for a millisecond.



Edited by dcjohnston
Link to post
Share on other sites

This is the full Code with error handler. If I close VB then the the autoit.exe file works fine.

Private Sub Command3_Click()
On Error GoTo ErrorHandler

    PlatformApp = Shell("c:\platformup.exe", 1)   ' Start Application
       AppActivate PlatformApp

ErrorHandler:                        ' Error-handling routine.
  Select Case Err.Number  ' Evaluate error number.
  Case 75
    Close #1    ' Close open file.
    Resume Next
  Case 53
    MsgBox "The Platform App was not found at C:\."
    Resume Next
  Case 5
    Resume Next
  Case Else
End Select
End Sub


Link to post
Share on other sites

If you could post the code for the script that would help us tell you the problem... It sounds like you have an If statement in your code (the fact that the autoit icon shows for a split second means that the code tried to run but it was exited before it could do anything) that is exiting because of a parameter that you supplied.


AutoIt Links

File-String Hash Plugin Updated! 04-02-2008 Plugins have been discontinued. I just found out.

ComputerGetInfo UDF's Updated! 11-23-2006

External Links

Vortex Revolutions Engineer / Inventor (Web, Desktop, and Mobile Applications, Hardware Gizmos, Consulting, and more)

Link to post
Share on other sites

Yup it was this code.... from the platformup.exe. This is the code from the examples in the help so everyone take note if you are using it.

$g_szVersion = "Platform Upgrade"
If WinExists($g_szVersion) Then Exit; It's already running

It was to keep the app from running multiple instances. Very interesting.

Thanks for your time.


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
  • Recently Browsing   0 members

    No registered users viewing this page.

  • Create New...