[Webinar] Streamline your web hosting managementRegister Today

x
?
Solved

joining

Posted on 1999-06-30
8
Medium Priority
?
205 Views
Last Modified: 2010-05-02
I´m curious... how can someone join 2 files in 1?

I´ve tried something like:

--------

Open ("c:\windows\desktop\test.exe") For Binary Access Read As #1
        Get #1, 1, firstfile
        Close #1
             
Open ("c:\windows\desktop\test2.exe") For Binary Access Read As #1
    Get #1, 1, secondfile
    Close #1
                                               
Open ("c:\windows\desktop\result.exe") For Binary Access Write As #1
    Put #1, , firstfile
    Put #1, , secondfile
    Close #1


--------

But I had no results!!
Does anyone know how to do such a thing?
Thx anyway!
0
Comment
Question by:alexbeaty
  • 4
  • 4
8 Comments
 
LVL 8

Accepted Solution

by:
MikeP090797 earned 200 total points
ID: 1521127
Try something like this:
Dim S1 as string, S2 as string
Open ("c:\windows\desktop\test.exe") For Binary Access Read As #1

S1=Space(Lof(1))
Get #1,,S1
Close #1

Open ("c:\windows\desktop\test.exe2") For Binary Access Read As #2

S2=Space(Lof(2))
Get #1,,S2
Close #2

Open ("c:\windows\desktop\result.exe") For Binary Access Write As #1
    Put #1, , S1
    Put #1, , S2
    Close #1






0
 

Author Comment

by:alexbeaty
ID: 1521128
It looks fine, but it gives an error while compiling in

Get #1,,S2
0
 

Author Comment

by:alexbeaty
ID: 1521129
Forget about the error that I said!!!

But seems that we have another problem!
When we join the 2 and the result of them is result.exe, this file has the size of the 2 together but when you run it, it only runs the first program in the file!!!

I thought when the result.exe was executed we could "extract" the 2 inside the result.exe to a temp directory, shell the 2 and kill the 2. This way they would run both seeming that it was the result.exe!

..., but just can´t figure how to do this!
Whats your opinion?
Thx for your help
0
Never miss a deadline with monday.com

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.

 
LVL 8

Expert Comment

by:MikeP090797
ID: 1521130
Well that's almost impossible to achieve I'd say. An EXE file has a special format, when you combine two files, this format is lost - the OS can't find the header and other stuff that are req. It's pretty amazing that the first one runs..
0
 

Author Comment

by:alexbeaty
ID: 1521131
I understand what you are saying, but is absolutely possible! I´ve seen one exe joiner and it works very well!
I think it works just like I described in my former comment! (extracting to a temp and shell them from there)
 
0
 
LVL 8

Expert Comment

by:MikeP090797
ID: 1521132
Well that's something more complex then just two files placed one after another. It's called self extracting EXE-the exe header is modified, so the os loads only part of the file as the exe, and not what actualy exists
0
 

Author Comment

by:alexbeaty
ID: 1521133
So how can I make a simple exe that is compact and when executed it will copy the 2 of them to a temp dir and shell them?

The only problem I see is that when ran it would take a while!!


0
 
LVL 8

Expert Comment

by:MikeP090797
ID: 1521134
That's  VERY complecated, and honestly, I don't know all the details. To start with, download the EXE file format from www.wotsit.org, it will give you an idea on what's involved, after that, you might reconsider this. Basicly it involves changing a few values in the exe header, like length, offsets, ect..
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…

591 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question