Question How To Open A EXE File ?

DJDruLotus

Member
Joined
May 7, 2009
Messages
8
Programming Experience
Beginner
Hello
Im Trying to open a exe file from the app
what im trying to do is make a cd of Fl Studio Pack That Have Like 6000 wav Sounds ,Skins, Plugins and more
im trying to put all that stuff in a installer that will install the file to the right folder
all the installer will be in difrent folder so when if they want to execute them with out running the program they can so
is there a way that i can open that installer EXE file from a folder ?
i try the Process1.Start() and try to put \Skins\Installer.exe and a error pop up
i try the shell command and same
the way it work for me is by putting C:\Skins/installer.exe, but the installer wont be on that drive when people get the cd/DVD, it will be in the drive the cd/DVD Rom is
so i dont have any idea on how to do this
 
Hi and Welcome to the Forum,

You could try this to find the first instance of the file on a cd drive.

VB.NET:
Dim PathToFileOnCD As String = ""
        Dim RelativePath As String = "\Skins\Installer.exe"

        For Each di As System.IO.DriveInfo In My.Computer.FileSystem.Drives
            If di.DriveType = IO.DriveType.CDRom Then
                If My.Computer.FileSystem.FileExists(My.Computer.FileSystem.CombinePath(di.Name, RelativePath)) Then
                    PathToFileOnCD = My.Computer.FileSystem.CombinePath(di.Name, RelativePath)
                End If
            End If
        Next

        If String.IsNullOrEmpty(PathToFileOnCD) Then
            MessageBox.Show("Not Found")
        Else
            MessageBox.Show("Found")
        End If

It may not be the most efficient and probably will be able to adjust it to better suit your needs.
 
I try that code it work a little but when i put the file in a cd the code find the file but it dont open it what i did i made a test ISO File To See How the code will work but it dont open the file
 
By opening the file do you mean running it a process?
for example: opening MyTextFile.txt with notepad

or do you mean that it opens it so you can read information out of the file without running it?

for example: programmatically opening MyTextFile.txt and reading the text from the file and then processing it.
 
Never Mind i found a way. the way i do it is with this code it work good

VB.NET:
System.Diagnostics.Process.Start("Skin\installer.exe")

Thanks for the help
 
Back
Top