How to execute a file in the same directory as your Xojo app?

I have an executable in the same directory as my Xojo executable that I want to shell to. How can I do that? I’m sure it’s easy I just can’t figure it out? I know I’ll use Shell but how do I point to the executable in the same directory?

I would use

Dim f As FolderItem = App.ExecutableFile.Parent.Child(“myexecutablefile”)
f.Launch

That will launch the app.

To do it with Shell I’d

Dim f As FolderItem = App.ExecutableFile.Parent.Child(“myexecutablefile”)
Dim sh As New Shell

sh.Execute(f.NativePath)

You should look at shell modes & timeout.

myexecutablefile will of course be the name of the app you wish to launch.

HTH

Wayne

If you just want to execute the file, try this:

Dim f as FolderItem

f = GetFolderItem(“my_file.exe”)

if f.Exists Then
f.Launch("") // parameters go here
end if

Are you targeting Windows or Mac?