Run Self-extracting exe

G

Guest

Hi
I have an exe which is actually a self-extracting zip file that i would like
to run to extract all the files.
I have the code showing how to use the j# classes and library to extract zip
files however it looks like these work on zip files only, not exe.

Does anyone know how to get around this? I would like to do it all without
having any user input. Using process.start() works however this asks the
user where to extract the files to which I don't want to do.
 
G

Guest

Hello to anyone else who is interested in this issue.
I have had no joy in finding a way of making the code itself extract the exe
therefore i have created a workaround. I have created a vb script that runs
the exe file and sends the required commands to work through the user
interface. A copy of this is below.
I hope this is useful to others.

wenz


Option Explicit

Dim objShell

Set objShell = WScript.CreateObject("WScript.Shell")

'Run the application
objShell.Run "CdData.exe", 9

'Sleep and then send the tab, tab and enter keys to select the unzip button
on
'the zip dialog box
WScript.Sleep 500
objShell.sendKeys "{tab}"
objShell.sendKeys "{tab}"
objShell.SendKeys "{enter}"

'sleep and then select enter to accept the dialog box advising files have
'been unzipped
WScript.Sleep 1000
objShell.SendKeys "{enter}"

'send four tabs and then the enter key to select the close button
objShell.sendKeys "{tab}"
objShell.sendKeys "{tab}"
objShell.sendKeys "{tab}"
objShell.sendKeys "{tab}"
objShell.SendKeys "{enter}"
 
B

Bruce Wood

Are there no command-line arguments to the self-extracting exe that
tell it to extract "silently" to a specific directory, rather than
throwing up the user interface?

I would think that you could just execute the exe from your j# program
and pass it the required command-line parameters...?
 
G

Guest

Thanks Bruce, that's a good suggestion. I'm a complete newbie at this and
running the vbscript was the first option I thought of after searching for
ages for a possible solution in c#. There may be a way to run it silently
however I couldn't find in my searching.

wenz
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top