self extracting exe


I am trying to automate a process and have been supplied self extracting exe's by a client.  The client will not supply anything else, so I am stuck with this route.

I am trying to find code to open and extract these files and place them into a directory of choice.

I've looked high and low and all the code that seems to be available via search engines involves creating self extracting exe's and not opening them.

Using 2008.

Any suggestions?

Thanks in advance!
Who is Participating?
swapneel_d14Connect With a Mentor Commented:
If it is self extracting Exe Can't you just do Process.Start

Dim startInfo As New ProcessStartInfo("C:\bdw\Vault 2.0\packinglist.exe")
    startInfo.Arguments = "CalledfromMIDAS"
Depending on the type of self extracting exe you may have no choice but to let it extract itself. There is no requirement that these files conform to any established standards, only that they be a valid exe.
Just use Process.Start(Application path)
Get your problem seen by more experts

Be seen. Boost your question’s priority for more expert views and faster solutions

I agree with the others. Allow the programs to extract themselves. However, since you're automating a process, you'll need to wait until it ends and then continue on:
pigfaceAuthor Commented:
Hi Thanks for the feedback.  This is my 1st time to pick up on this thread since the new year.

All seems logical, but how would I specify where the contents get unzipped?  On a self extracting exe, you can specify the destination folder and none of the examples show that.

Thanks again for your help

It can be done, but it's not going to be easy. More than likely, what you'd have to do is utilize some Windows APIs and automate the pressing of buttons that way. But that's less than ideal.

However, you can extract the contents of the self-extracting executable and do with them as you wish.

In the past I've used UniExtractor. It has worked well for me in the past.


If you don't want to go this route then I'll come up with a way to extract it.
pigfaceAuthor Commented:
Apologies for my delay, the UK has had lots of snow and I have been trapped in my very rural house away from work.

I figured it out and I will assign points to Swapneel as he led me in the right direction.

Here is the solution for what it is worth.  NB.  arguments and /auto play a big part in it running.  Also another stumbling block is that if you run this on a shared drive then you will get those annoying pop ups requesting "is it safe to run the exe blah blah blah"

try this to cure that:

    Private Sub UnZipFile(ByVal ZipFile As String, ByVal DestFolder As String)

        Dim StartZip As New Diagnostics.Process

            StartZip.StartInfo.FileName = """" & ZipFile & """"
            StartZip.StartInfo.Arguments = " /auto " & """" & DestFolder & """"
            StartZip.StartInfo.WindowStyle = ProcessWindowStyle.Hidden


            Dts.TaskResult = Dts.Results.Success

        Catch ex As Exception
            Dts.TaskResult = Dts.Results.Failure

            StartZip = Nothing
        End Try

    End Sub

I think I should assign some points to myself too :)
pigfaceAuthor Commented:
only a partial answer hence B and I did have a lot of head scratching myself.  I was going to give C, but you did help.
Well done mate.  Thank yuu for the Points.
But Becuase of snow in uk and transportation mess couldnt punt much time on your thread.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.